Commit 43fd3212 authored by Michael Niedermayer's avatar Michael Niedermayer

targa: Fix input buffer size check.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8f0d9b43
...@@ -229,7 +229,7 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -229,7 +229,7 @@ static int decode_frame(AVCodecContext *avctx,
buf += res; buf += res;
}else{ }else{
size_t img_size = s->width * ((s->bpp + 1) >> 3); 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++){ for(y = 0; y < s->height; y++){
memcpy(dst, buf, img_size); memcpy(dst, buf, img_size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment