summaryrefslogtreecommitdiff
path: root/libavcodec/targa.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-27 00:12:03 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-03-27 00:45:32 +0200
commit43fd3212521e3a44b99a6b1ef9bf9bcdddd086e8 (patch)
treee8cdf53df82c56a404329360f5151249d4a0af01 /libavcodec/targa.c
parent8f0d9b43bea95fc16e334bbcbf0fa1cb5dd2a17c (diff)
targa: Fix input buffer size check.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/targa.c')
-rw-r--r--libavcodec/targa.c2
1 files changed, 1 insertions, 1 deletions
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);