[FFmpeg-devel] [PATCH] avoid division by zero in libavformat/dv.c

Reinhard Tartler siretart
Sat Apr 3 14:05:31 CEST 2010


Found by report posted at:
http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/107290

Fixes: http://tranquillity.ath.cx/clang/2010-04-02-1/report-Yx4BnH.html#EndPath

Index: libavformat/dv.c
===================================================================
--- libavformat/dv.c	(revision 22580)
+++ libavformat/dv.c	(working copy)
@@ -122,6 +122,9 @@
     size = (sys->audio_min_samples[freq] + smpls) * 4; /* 2ch, 2bytes */
     half_ch = sys->difseg_size / 2;
 
+    if (half_ch == 0)
+	    return -1;
+
     /* We work with 720p frames split in half, thus even frames have
      * channels 0,1 and odd 2,3. */
     ipcm = (sys->height == 720 && !(frame[1] & 0x0C)) ? 2 : 0;


-- 
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4




More information about the ffmpeg-devel mailing list