huffyuvenc: switch to ff_alloc_packet2()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-03-22 04:24:41 +01:00
parent 5dadfaa9f5
commit e180079c1f
1 changed files with 2 additions and 3 deletions

View 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;
}