Commit 904a2864 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/ffv1enc: fix size used for ff_alloc_packet2()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 9a0e2081
...@@ -1015,9 +1015,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, ...@@ -1015,9 +1015,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
uint8_t keystate = 128; uint8_t keystate = 128;
uint8_t *buf_p; uint8_t *buf_p;
int i, ret; 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 if ((ret = ff_alloc_packet2(avctx, pkt, maxsize)) < 0)
+ FF_MIN_BUFFER_SIZE)) < 0)
return ret; return ret;
ff_init_range_encoder(c, pkt->data, pkt->size); ff_init_range_encoder(c, pkt->data, pkt->size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment