# HG changeset patch # User michael # Date 1180566397 0 # Node ID a10ebd496bd9adc5275add1b7b5c8125e40db4fe # Parent 81bbca75ae2f38a06a0cfcbf95da1ba0f9b230f4 sanity checks (should prevent hypothetical div by zero issue) should fix sf bug #1547313 diff -r 81bbca75ae2f -r a10ebd496bd9 wma.c --- a/wma.c Wed May 30 21:38:57 2007 +0000 +++ b/wma.c Wed May 30 23:06:37 2007 +0000 @@ -72,6 +72,11 @@ 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; diff -r 81bbca75ae2f -r a10ebd496bd9 wmadec.c --- a/wmadec.c Wed May 30 21:38:57 2007 +0000 +++ b/wmadec.c Wed May 30 23:06:37 2007 +0000 @@ -106,7 +106,8 @@ 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++)