diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-11-11 19:53:22 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-11-11 21:31:56 +0100 |
commit | f9b89b61f819535b4dbe6c3e9f0d6fc8becf64cb (patch) | |
tree | 6c8590f3702ced99563a8ed1e0b96c14cff92da8 /libavformat/electronicarts.c | |
parent | 20769d9349ba598822334d666ef1f3e387df2dff (diff) | |
download | ffmpeg-f9b89b61f819535b4dbe6c3e9f0d6fc8becf64cb.tar.gz |
avformat/electronicarts: check chunksize more completely in probe()
Fixes probetest failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/electronicarts.c')
-rw-r--r-- | libavformat/electronicarts.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c index 3694a02176..dd8cf5d644 100644 --- a/libavformat/electronicarts.c +++ b/libavformat/electronicarts.c @@ -440,6 +440,8 @@ static int process_ea_header(AVFormatContext *s) static int ea_probe(AVProbeData *p) { + unsigned big_endian, size; + switch (AV_RL32(&p->buf[0])) { case ISNh_TAG: case SCHl_TAG: @@ -454,7 +456,11 @@ static int ea_probe(AVProbeData *p) default: 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 AVPROBE_SCORE_MAX; |