From 43fd3212521e3a44b99a6b1ef9bf9bcdddd086e8 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 27 Mar 2012 00:12:03 +0200 Subject: [PATCH] targa: Fix input buffer size check. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- libavcodec/targa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/targa.c b/libavcodec/targa.c index 5ddd21bfef..55841956ad 100644 --- a/libavcodec/targa.c +++ b/libavcodec/targa.c @@ -229,7 +229,7 @@ static int decode_frame(AVCodecContext *avctx, buf += res; }else{ size_t img_size = s->width * ((s->bpp + 1) >> 3); - CHECK_BUFFER_SIZE(buf, buf_end, img_size, "image data"); + CHECK_BUFFER_SIZE(buf, buf_end, img_size * s->height , "image data"); for(y = 0; y < s->height; y++){ memcpy(dst, buf, img_size); -- 2.11.0