Commit 652ac42d authored by reynaldo's avatar reynaldo

Smarten mtv's probe a bit. Check for non zero

on bpp and width|height header fields. This
change is among the ones suggested by Vitor
Sessak in his '[FFmpeg-devel] [PATCH] Improve
MTV probe' thread.



git-svn-id: file:///var/local/repositories/ffmpeg/trunk@20283 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 77910ac1
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
*/ */
#include "libavutil/bswap.h" #include "libavutil/bswap.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h" #include "avformat.h"
#define MTV_ASUBCHUNK_DATA_SIZE 500 #define MTV_ASUBCHUNK_DATA_SIZE 500
...@@ -56,6 +57,10 @@ static int mtv_probe(AVProbeData *p) ...@@ -56,6 +57,10 @@ static int mtv_probe(AVProbeData *p)
if(*(p->buf) != 'A' || *(p->buf+1) != 'M' || *(p->buf+2) != 'V') if(*(p->buf) != 'A' || *(p->buf+1) != 'M' || *(p->buf+2) != 'V')
return 0; return 0;
/* Check for nonzero in bpp and (width|height) header fields */
if(!(p->buf[51] && AV_RL16(&p->buf[52]) | AV_RL16(&p->buf[54])))
return 0;
return AVPROBE_SCORE_MAX; return AVPROBE_SCORE_MAX;
} }
......
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