aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ffv1enc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-09 17:36:01 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-09 20:19:08 +0200
commit904a2864bdafe19d18db95ca54dfb36d72957a16 (patch)
tree8553f2d0df810aa2b3efda1baab3fafa6e4a7fdd /libavcodec/ffv1enc.c
parent9a0e20817aeedbd11fb019e35bae00c2a12cc3e3 (diff)
downloadandroid_external_ffmpeg-904a2864bdafe19d18db95ca54dfb36d72957a16.tar.gz
android_external_ffmpeg-904a2864bdafe19d18db95ca54dfb36d72957a16.tar.bz2
android_external_ffmpeg-904a2864bdafe19d18db95ca54dfb36d72957a16.zip
avcodec/ffv1enc: fix size used for ff_alloc_packet2()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ffv1enc.c')
-rw-r--r--libavcodec/ffv1enc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index 6baa7e97bf..7c1b30a147 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -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);