Commit 73a51e00 authored by Michael Niedermayer's avatar Michael Niedermayer

mjpeg: Detect overreads in mjpeg_decode_scan() and error out.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 3eb15d98
......@@ -797,6 +797,10 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah, i
if (s->restart_interval && !s->restart_count)
s->restart_count = s->restart_interval;
if(get_bits_count(&s->gb)>s->gb.size_in_bits){
av_log(s->avctx, AV_LOG_ERROR, "overread %d\n", get_bits_count(&s->gb) - s->gb.size_in_bits);
return -1;
}
for(i=0;i<nb_components;i++) {
uint8_t *ptr;
int n, h, v, x, y, c, j;
......
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