[FFmpeg-cvslog] iff: Do not read over the source buffer

Luca Barbato git at videolan.org
Sun Sep 22 13:51:08 CEST 2013


ffmpeg | branch: release/0.10 | Luca Barbato <lu_zero at gentoo.org> | Sat Jun 29 07:26:48 2013 +0200| [195b9f290cb61f2af1204970c8088c941647e90a] | committer: Luca Barbato

iff: Do not read over the source buffer

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
(cherry picked from commit 7d65e960c72f36b73ae7fe84f8e427d758e61da9)

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

Conflicts:
	libavcodec/iff.c

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

 libavcodec/iff.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index 41e7b59..b931e40 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -271,7 +271,7 @@ static int decode_frame_ilbm(AVCodecContext *avctx,
 
     if (avctx->codec_tag == MKTAG('I','L','B','M')) { // interleaved
         if (avctx->pix_fmt == PIX_FMT_PAL8 || avctx->pix_fmt == PIX_FMT_GRAY8) {
-            for(y = 0; y < avctx->height; y++ ) {
+            for (y = 0; y < avctx->height && buf < buf_end; y++ ) {
                 uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ];
                 memset(row, 0, avctx->width);
                 for (plane = 0; plane < avctx->bits_per_coded_sample && buf < buf_end; plane++) {



More information about the ffmpeg-cvslog mailing list