shithub: opus

Download patch

ref: 55513e81d8f606bd75d0ff773d2144e5f2a732f5
parent: 4a344aff026079af4478c77ec54d2573fd6ec85f
author: Jean-Marc Valin <jeanmarcv@google.com>
date: Tue Mar 18 09:41:14 EDT 2025

Fix multiple unsequenced modifications

Could only happen on 32-bit fixed-point builds.
The bug was introduced in 4ba06d9e.

--- a/celt/bands.c
+++ b/celt/bands.c
@@ -264,13 +264,15 @@
             shift = -2;
          }
          do {
-            *f++ = SHL32(MULT16_32_Q15(*x++, g), -shift);
+            *f++ = SHL32(MULT16_32_Q15(*x, g), -shift);
+            x++;
          } while (++j<band_end);
       } else
 #endif
          /* Be careful of the fixed-point "else" just above when changing this code */
          do {
-            *f++ = SHR32(MULT16_32_Q15(*x++, g), shift);
+            *f++ = SHR32(MULT16_32_Q15(*x, g), shift);
+            x++;
          } while (++j<band_end);
    }
    celt_assert(start <= end);
--