aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-06-29 07:26:48 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-08-24 11:38:48 +0200
commitc4e2758eecbcc73621a478b71d29a4b2397ca727 (patch)
treea8048bc59b04940b3009082b68d3fb3297da6cd5
parent9f1c3cd5ad07812a70c7a21c4b5f2d6367e02a35 (diff)
downloadffmpeg-c4e2758eecbcc73621a478b71d29a4b2397ca727.tar.gz
iff: Do not read over the source buffer
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org (cherry picked from commit 7d65e960c72f36b73ae7fe84f8e427d758e61da9) Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r--libavcodec/iff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index 99da7b5d61..b7a7bb3d51 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -272,7 +272,7 @@ static int decode_frame_ilbm(AVCodecContext *avctx,
if (avctx->codec_tag == MKTAG('I','L','B','M')) { // interleaved
if (avctx->pix_fmt == AV_PIX_FMT_PAL8 || avctx->pix_fmt == AV_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++) {