avformat/electronicarts: check chunksize more completely in probe()

Fixes probetest failure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-11-11 19:53:22 +01:00
parent 20769d9349
commit f9b89b61f8
1 changed files with 7 additions and 1 deletions

View File

@ -440,6 +440,8 @@ static int process_ea_header(AVFormatContext *s)
static int ea_probe(AVProbeData *p) static int ea_probe(AVProbeData *p)
{ {
unsigned big_endian, size;
switch (AV_RL32(&p->buf[0])) { switch (AV_RL32(&p->buf[0])) {
case ISNh_TAG: case ISNh_TAG:
case SCHl_TAG: case SCHl_TAG:
@ -454,7 +456,11 @@ static int ea_probe(AVProbeData *p)
default: default:
return 0; return 0;
} }
if (AV_RL32(&p->buf[4]) > 0xfffff && AV_RB32(&p->buf[4]) > 0xfffff) size = AV_RL32(&p->buf[4]);
big_endian = size > 0x000FFFFF;
if (big_endian)
size = av_bswap32(size);
if (size > 0xfffff || size < 8)
return 0; return 0;
return AVPROBE_SCORE_MAX; return AVPROBE_SCORE_MAX;