summaryrefslogtreecommitdiff
path: root/libavformat/flic.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-07-14 22:55:07 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-07-14 22:55:07 +0000
commit154dffd04c5da3db282c4d2f17f6dd2c5dbf951d (patch)
treeaedf41ef3f7aa16380d1c46996df3b6fa536bebb /libavformat/flic.c
parent744b4c02c209d3781a12d4248b3a2a075dbf243c (diff)
Make flic probe check a few more things.
fixes issue399 Originally committed as revision 14235 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/flic.c')
-rw-r--r--libavformat/flic.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavformat/flic.c b/libavformat/flic.c
index f22a5eec3e..62ea94ef63 100644
--- a/libavformat/flic.c
+++ b/libavformat/flic.c
@@ -54,12 +54,25 @@ static int flic_probe(AVProbeData *p)
{
int magic_number;
+ if(p->buf_size < FLIC_HEADER_SIZE)
+ return 0;
+
magic_number = AV_RL16(&p->buf[4]);
if ((magic_number != FLIC_FILE_MAGIC_1) &&
(magic_number != FLIC_FILE_MAGIC_2) &&
(magic_number != FLIC_FILE_MAGIC_3))
return 0;
+ if(AV_RL16(&p->buf[0x10]) != FLIC_CHUNK_MAGIC_1){
+ if(AV_RL32(&p->buf[0x10]) > 2000)
+ return 0;
+ }
+
+ if( AV_RL16(&p->buf[0x08]) > 4096
+ || AV_RL16(&p->buf[0x0A]) > 4096)
+ return 0;
+
+
return AVPROBE_SCORE_MAX;
}