Commit 4dfb7dbe authored by diego's avatar diego

Fix an underflow/overflow that was causing some crackles when playing

certain THP files.
patch by Marco Gerards, mgerards xs4all nl


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@8703 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 6e1a28d8
......@@ -1359,8 +1359,10 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
if(n&1) sampledat= *src++ <<28;
else sampledat= (*src&0xF0)<<24;
*samples = ((prev[ch][0]*factor1
sampledat = ((prev[ch][0]*factor1
+ prev[ch][1]*factor2) >> 11) + (sampledat>>exp);
CLAMP_TO_SHORT(sampledat);
*samples = sampledat;
prev[ch][1] = prev[ch][0];
prev[ch][0] = *samples++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment