targa: Fix input buffer size check.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/4/head
Michael Niedermayer 13 years ago
parent 8f0d9b43be
commit 43fd321252
  1. 2
      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);

Loading…
Cancel
Save