[FFmpeg-cvslog] huffyuvenc: switch to ff_alloc_packet2()

Michael Niedermayer git at videolan.org
Thu Mar 22 19:10:26 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Mar 22 04:24:41 2012 +0100| [e180079c1f48cb5342677f33a7547562f34bc206] | committer: Michael Niedermayer

huffyuvenc: switch to ff_alloc_packet2()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e180079c1f48cb5342677f33a7547562f34bc206
---

 libavcodec/huffyuv.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c
index afc395a..7082ed8 100644
--- a/libavcodec/huffyuv.c
+++ b/libavcodec/huffyuv.c
@@ -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;
     }
 



More information about the ffmpeg-cvslog mailing list