[FFmpeg-cvslog] r9164 - in trunk/libavcodec: wma.c wmadec.c

michael subversion
Thu May 31 01:06:38 CEST 2007


Author: michael
Date: Thu May 31 01:06:37 2007
New Revision: 9164

Log:
sanity checks (should prevent hypothetical div by zero issue)
should fix sf bug #1547313


Modified:
   trunk/libavcodec/wma.c
   trunk/libavcodec/wmadec.c

Modified: trunk/libavcodec/wma.c
==============================================================================
--- trunk/libavcodec/wma.c	(original)
+++ trunk/libavcodec/wma.c	Thu May 31 01:06:37 2007
@@ -72,6 +72,11 @@ int ff_wma_init(AVCodecContext * avctx, 
     int sample_rate1;
     int coef_vlc_table;
 
+    if(   avctx->sample_rate<=0 || avctx->sample_rate>50000
+       || avctx->channels<=0 || avctx->channels>8
+       || avctx->bit_rate<=0)
+        return -1;
+
     s->sample_rate = avctx->sample_rate;
     s->nb_channels = avctx->channels;
     s->bit_rate = avctx->bit_rate;

Modified: trunk/libavcodec/wmadec.c
==============================================================================
--- trunk/libavcodec/wmadec.c	(original)
+++ trunk/libavcodec/wmadec.c	Thu May 31 01:06:37 2007
@@ -106,7 +106,8 @@ static int wma_decode_init(AVCodecContex
     s->use_bit_reservoir = flags2 & 0x0002;
     s->use_variable_block_len = flags2 & 0x0004;
 
-    ff_wma_init(avctx, flags2);
+    if(ff_wma_init(avctx, flags2)<0)
+        return -1;
 
     /* init MDCT */
     for(i = 0; i < s->nb_block_sizes; i++)




More information about the ffmpeg-cvslog mailing list