avcodec/ffv1enc: fix size used for ff_alloc_packet2()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-09-09 17:36:01 +02:00
parent 9a0e20817a
commit 904a2864bd
1 changed files with 3 additions and 2 deletions

View File

@ -1015,9 +1015,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
uint8_t keystate = 128;
uint8_t *buf_p;
int i, ret;
int64_t maxsize = FF_MIN_BUFFER_SIZE
+ avctx->width*avctx->height*35LL*4;
if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width*avctx->height*((8*2+1+1)*4)/8
+ FF_MIN_BUFFER_SIZE)) < 0)
if ((ret = ff_alloc_packet2(avctx, pkt, maxsize)) < 0)
return ret;
ff_init_range_encoder(c, pkt->data, pkt->size);