[FFmpeg-cvslog] avcodec/ffv1enc: fix size used for ff_alloc_packet2()
Michael Niedermayer
git at videolan.org
Mon Sep 9 20:27:19 CEST 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Sep 9 17:36:01 2013 +0200| [904a2864bdafe19d18db95ca54dfb36d72957a16] | committer: Michael Niedermayer
avcodec/ffv1enc: fix size used for ff_alloc_packet2()
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=904a2864bdafe19d18db95ca54dfb36d72957a16
---
libavcodec/ffv1enc.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index 6baa7e9..7c1b30a 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);
More information about the ffmpeg-cvslog
mailing list