[FFmpeg-cvslog] libavformat/mtv: donwgrade probe score for < 512

Reynaldo H. Verdejo Pinochet git at videolan.org
Thu Jan 23 21:41:32 CET 2014


ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet <r.verdejo at sisa.samsung.com> | Thu Jan 23 16:03:09 2014 -0300| [d467e7df1a74b74eaea27434b1c4de17518f400f] | committer: Reynaldo H. Verdejo Pinochet

libavformat/mtv: donwgrade probe score for < 512

MTV has a 512 bytes header. We should be able to
parse required fiels from the first 57 (rest is
padding) but if we haven't seen enough data then
go with SCORE_EXTENSION.

Signed-off-by: Reynaldo H. Verdejo Pinochet <r.verdejo at sisa.samsung.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d467e7df1a74b74eaea27434b1c4de17518f400f
---

 libavformat/mtv.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavformat/mtv.c b/libavformat/mtv.c
index 5e638ca..0ce3f8e 100644
--- a/libavformat/mtv.c
+++ b/libavformat/mtv.c
@@ -78,6 +78,13 @@ static int mtv_probe(AVProbeData *p)
     if(p->buf[51] != 16)
         return AVPROBE_SCORE_EXTENSION / 2; // But we are going to assume 16bpp anyway ..
 
+    /* We had enough data to parse header values
+     * but we expect to be able to get 512 bytes
+     * of header to be sure.
+     */
+    if (p->buf_size < MTV_HEADER_SIZE)
+        return AVPROBE_SCORE_EXTENSION;
+
     return AVPROBE_SCORE_MAX;
 }
 



More information about the ffmpeg-cvslog mailing list