[FFmpeg-cvslog] targa: Fix input buffer size check.

Michael Niedermayer git at videolan.org
Tue Mar 27 01:14:50 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Mar 27 00:12:03 2012 +0200| [43fd3212521e3a44b99a6b1ef9bf9bcdddd086e8] | committer: Michael Niedermayer

targa: Fix input buffer size check.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/targa.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/targa.c b/libavcodec/targa.c
index 5ddd21b..5584195 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);
 



More information about the ffmpeg-cvslog mailing list