[FFmpeg-cvslog] r21029 - trunk/libavcodec/alsdec.c

Uoti Urpala uoti.urpala
Tue Jan 5 07:19:28 CET 2010


On Tue, 2010-01-05 at 06:55 +0100, Reimar D?ffinger wrote:
> On Tue, Jan 05, 2010 at 02:16:02AM +0100, thilo.borgmann wrote:
> > Author: thilo.borgmann
> > Date: Tue Jan  5 02:16:02 2010
> > New Revision: 21029
> > 
> > Log:
> > Replace array operator [] with direct access via pointer.
> > Solves issue 1657.
> 
> *scratch*. How can that solve an issue?

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

My guess is that the actual cause of the crash was wrapping arithmetic
in the original subtraction ("smp" is unsigned). The new version changes
precedence from raw_samples+(smp-(sb+1)) to (raw_samples+smp)-(sb+1); if
for example smp=sb=0 this changes the result from raw_samples+UINT_MAX
to raw_samples-1.




More information about the ffmpeg-cvslog mailing list