[FFmpeg-cvslog] ffv1enc: fix integer overflow with high resolutions and lots of slices.

Michael Niedermayer git at videolan.org
Mon Dec 3 20:33:40 CET 2012


ffmpeg | branch: release/1.0 | Michael Niedermayer <michaelni at gmx.at> | Sat Sep 29 19:11:25 2012 +0200| [3be4f230c6152fb88cfd23bb90aed3fc474e093b] | committer: Michael Niedermayer

ffv1enc: fix integer overflow with high resolutions and lots of slices.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit f049729e613ed3fb0abf767eb14423f545385c6e)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3be4f230c6152fb88cfd23bb90aed3fc474e093b
---

 libavcodec/ffv1.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c
index 8f89542..572bcbb 100644
--- a/libavcodec/ffv1.c
+++ b/libavcodec/ffv1.c
@@ -1313,9 +1313,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
     for(i=1; i<f->slice_count; i++){
         FFV1Context *fs= f->slice_context[i];
-        uint8_t *start = pkt->data + (pkt->size-used_count)*i/f->slice_count;
+        uint8_t *start = pkt->data + (pkt->size-used_count)*(int64_t)i/f->slice_count;
         int len = pkt->size/f->slice_count;
-
         ff_init_range_encoder(&fs->c, start, len);
     }
     avctx->execute(avctx, encode_slice, &f->slice_context[0], NULL, f->slice_count, sizeof(void*));



More information about the ffmpeg-cvslog mailing list