Browse Source

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
tags/v0.6
Reynaldo H. Verdejo Pinochet 16 years ago
parent
commit
f122ef36b1
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavformat/mtv.c

+ 5
- 0
libavformat/mtv.c View File

@@ -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;
}



Loading…
Cancel
Save