huffyuvenc: switch to ff_alloc_packet2()
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 22 Mar 2012 03:24:41 +0000 (04:24 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 22 Mar 2012 18:03:19 +0000 (19:03 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/huffyuv.c

index afc395a..7082ed8 100644 (file)
@@ -29,6 +29,7 @@
  */
 
 #include "avcodec.h"
+#include "internal.h"
 #include "get_bits.h"
 #include "put_bits.h"
 #include "dsputil.h"
@@ -1278,9 +1279,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     AVFrame * const p= &s->picture;
     int i, j, size = 0, ret;
 
-    if (!pkt->data &&
-        (ret = av_new_packet(pkt, width * height * 3 * 4 + FF_MIN_BUFFER_SIZE)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error allocating output packet.\n");
+    if ((ret = ff_alloc_packet2(avctx, pkt, width * height * 3 * 4 + FF_MIN_BUFFER_SIZE)) < 0) {
         return ret;
     }