Commit 2cda1a16 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/dvbsub: Fix hypothetical pointer overflow in dvbsub_probe()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 32c4b504
......@@ -37,7 +37,7 @@ static int dvbsub_probe(AVProbeData *p)
const uint8_t *ptr = p->buf + i;
uint8_t histogram[6] = {0};
int min = 255;
for(j=0; ptr + 6 < end; j++) {
for(j=0; 6 < end - ptr; j++) {
if (*ptr != 0x0f)
break;
type = ptr[1];
......@@ -49,6 +49,8 @@ static int dvbsub_probe(AVProbeData *p)
histogram[type - 0x10] ++;
} else
break;
if (6 + len > end - ptr)
break;
ptr += 6 + len;
}
for (k=0; k < 4; k++) {
......
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