From: Michael Niedermayer Date: Thu, 22 Mar 2012 03:25:20 +0000 (+0100) Subject: lclenc: switch to ff_alloc_packet2() X-Git-Tag: android-x86-4.4-r1~12907 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=620559e37b4e3cd74858b89c05c30d4215428000;p=android-x86%2Fexternal-ffmpeg.git lclenc: switch to ff_alloc_packet2() Signed-off-by: Michael Niedermayer --- diff --git a/libavcodec/lclenc.c b/libavcodec/lclenc.c index a656986da9..854968b452 100644 --- a/libavcodec/lclenc.c +++ b/libavcodec/lclenc.c @@ -42,6 +42,7 @@ #include #include "avcodec.h" +#include "internal.h" #include "lcl.h" #include @@ -77,9 +78,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, int zret; // Zlib return code int max_size = deflateBound(&c->zstream, avctx->width * avctx->height * 3); - if (!pkt->data && - (ret = av_new_packet(pkt, max_size)) < 0) { - av_log(avctx, AV_LOG_ERROR, "Error allocating packet of size %d.\n", max_size); + if ((ret = ff_alloc_packet2(avctx, pkt, max_size)) < 0) { return ret; }