[FFmpeg-cvslog] r19838 - trunk/libavformat/idcin.c

reimar subversion
Mon Sep 14 17:44:05 CEST 2009


Author: reimar
Date: Mon Sep 14 17:44:05 2009
New Revision: 19838

Log:
Check buffer size for idcin check, otherwise false positives are too likely for
small probe buffer sizes due to 0-padding (see probetest results).

Modified:
   trunk/libavformat/idcin.c

Modified: trunk/libavformat/idcin.c
==============================================================================
--- trunk/libavformat/idcin.c	Mon Sep 14 11:59:32 2009	(r19837)
+++ trunk/libavformat/idcin.c	Mon Sep 14 17:44:05 2009	(r19838)
@@ -105,6 +105,11 @@ static int idcin_probe(AVProbeData *p)
      * audio channels: 0 for no audio, or 1 or 2
      */
 
+    /* check we have enough data to do all checks, otherwise the
+       0-padding may cause a wrong recognition */
+    if (p->buf_size < 20)
+        return 0;
+
     /* check the video width */
     number = AV_RL32(&p->buf[0]);
     if ((number == 0) || (number > 1024))



More information about the ffmpeg-cvslog mailing list