[FFmpeg-devel] [PATCH] ALS: Solve Issue 1657

Carl Eugen Hoyos cehoyos
Tue Jan 5 00:55:50 CET 2010


Thilo Borgmann <thilo.borgmann <at> googlemail.com> writes:

> > issue 1657 seems to be caused by negative indices used in [].
> > See: http://roundup.ffmpeg.org/roundup/ffmpeg/issue1657
> > 
> > Using *() resolves this issue.
> > 
> > Tested with gcc 4.0 on MacOS 10.6. There were other versions/compilers
> > mentioned in roundup, maybe these could be tested by someone (you)?

Second patch works fine for icc 11.1

Carl Eugen

Index: libavcodec/alsdec.c
===================================================================
--- libavcodec/alsdec.c (revision 21025)
+++ libavcodec/alsdec.c (working copy)
@@ -739,7 +739,7 @@
             y = 1 << 19;

             for (sb = 0; sb < smp; sb++)
-                y += MUL64(lpc_cof[sb],raw_samples[smp - (sb + 1)]);
+                y += MUL64(lpc_cof[sb], *(raw_samples + smp - (sb + 1)));

             raw_samples[smp] -= y >> 20;
             parcor_to_lpc(smp, quant_cof, lpc_cof);
@@ -780,7 +780,7 @@
         y = 1 << 19;

         for (sb = 0; sb < opt_order; sb++)
-            y += MUL64(bd->lpc_cof[sb],raw_samples[smp - (sb + 1)]);
+            y += MUL64(bd->lpc_cof[sb], *(raw_samples + smp - (sb + 1)));

         raw_samples[smp] -= y >> 20;
     }





More information about the ffmpeg-devel mailing list