aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReynaldo H. Verdejo Pinochet <reynaldo@opendot.cl>2009-10-18 18:02:12 +0000
committerReynaldo H. Verdejo Pinochet <reynaldo@opendot.cl>2009-10-18 18:02:12 +0000
commitf122ef36b198577ce2ef91224369032ccbef626b (patch)
tree9fb4b28be5556176a04b817f1e1782f64a9d19ed
parenta828d48cfc73d244c3ab9bf19ba0e057f5439036 (diff)
downloadffmpeg-f122ef36b198577ce2ef91224369032ccbef626b.tar.gz
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. Originally committed as revision 20283 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/mtv.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/mtv.c b/libavformat/mtv.c
index 42aa91f7b3..ef07e4a3b0 100644
--- a/libavformat/mtv.c
+++ b/libavformat/mtv.c
@@ -25,6 +25,7 @@
*/
#include "libavutil/bswap.h"
+#include "libavutil/intreadwrite.h"
#include "avformat.h"
#define MTV_ASUBCHUNK_DATA_SIZE 500
@@ -56,6 +57,10 @@ static int mtv_probe(AVProbeData *p)
if(*(p->buf) != 'A' || *(p->buf+1) != 'M' || *(p->buf+2) != 'V')
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;
}