[FFmpeg-devel] [PATCH] DIV0 in intrax8

Roine Gustafsson roine
Wed Jan 16 11:38:52 CET 2008


Feeding garbage to wmv2 can cause a DIV0. This at least prevents the  
crash.

--- intrax8.c   (revision 11538)
+++ intrax8.c   (working copy)
@@ -698,12 +698,14 @@
      w->quant  = dquant >> 1;
      w->qsum   = quant_offset;

+    if (w->quant)
      w->divide_quant_dc_luma = ((1<<16) + (w->quant>>1)) / w->quant;
      if(w->quant < 5){
          w->quant_dc_chroma =  w->quant;
          w->divide_quant_dc_chroma = w->divide_quant_dc_luma;
      }else{
          w->quant_dc_chroma =  w->quant+((w->quant+3)>>3);
+        if (w->quant_dc_chroma)
          w->divide_quant_dc_chroma = ((1<<16) + (w- 
 >quant_dc_chroma>>1)) / w->quant_dc_chroma;
      }
      x8_reset_vlc_tables(w);

-------------- next part --------------
A non-text attachment was scrubbed...
Name: intrax8.diff
Type: application/octet-stream
Size: 679 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080116/57575272/attachment.obj>



More information about the ffmpeg-devel mailing list