[FFmpeg-cvslog] r19850 - trunk/libavformat/sierravmd.c

reimar subversion
Tue Sep 15 11:16:30 CEST 2009


Author: reimar
Date: Tue Sep 15 11:16:29 2009
New Revision: 19850

Log:
Improve sierravmd probe. It is still quite weak, but further improvements
are non-obvious and probably need a large (about 1kB at least) probe buffer.

Modified:
   trunk/libavformat/sierravmd.c

Modified: trunk/libavformat/sierravmd.c
==============================================================================
--- trunk/libavformat/sierravmd.c	Tue Sep 15 01:03:33 2009	(r19849)
+++ trunk/libavformat/sierravmd.c	Tue Sep 15 11:16:29 2009	(r19850)
@@ -61,10 +61,17 @@ typedef struct VmdDemuxContext {
 
 static int vmd_probe(AVProbeData *p)
 {
+    int w, h;
+    if (p->buf_size < 16)
+        return 0;
     /* check if the first 2 bytes of the file contain the appropriate size
      * of a VMD header chunk */
     if (AV_RL16(&p->buf[0]) != VMD_HEADER_SIZE - 2)
         return 0;
+    w = AV_RL16(&p->buf[12]);
+    h = AV_RL16(&p->buf[14]);
+    if (!w || w > 2048 || !h || h > 2048)
+        return 0;
 
     /* only return half certainty since this check is a bit sketchy */
     return AVPROBE_SCORE_MAX / 2;



More information about the ffmpeg-cvslog mailing list