# HG changeset patch # User michael # Date 1216076107 0 # Node ID a81d82e21714ee21a2d41ba8e713cf052a5460ec # Parent 813a493658ee7c3a4d873de854b1b46fbd58fc45 Make flic probe check a few more things. fixes issue399 diff -r 813a493658ee -r a81d82e21714 flic.c --- a/flic.c Mon Jul 14 20:31:17 2008 +0000 +++ b/flic.c Mon Jul 14 22:55:07 2008 +0000 @@ -54,12 +54,25 @@ { 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; }