[FFmpeg-soc] [soc]: r4994 - amr/amrnbdec.c

cmcq subversion at mplayerhq.hu
Sat Aug 8 23:10:12 CEST 2009


Author: cmcq
Date: Sat Aug  8 23:10:12 2009
New Revision: 4994

Log:
Prevent diff_count from overflowing

Modified:
   amr/amrnbdec.c

Modified: amr/amrnbdec.c
==============================================================================
--- amr/amrnbdec.c	Sat Aug  8 23:01:30 2009	(r4993)
+++ amr/amrnbdec.c	Sat Aug  8 23:10:12 2009	(r4994)
@@ -686,8 +686,10 @@ static float fixed_gain_smooth(AMRContex
     // hangover period.
     p->diff_count = diff > 0.65 ? p->diff_count + 1 : 0;
 
-    if (p->diff_count > 10)
+    if (p->diff_count > 10) {
         p->hang_count = 0;
+        p->diff_count--; // don't let diff_count overflow
+    }
 
     if (p->hang_count < 40) {
         p->hang_count++;


More information about the FFmpeg-soc mailing list