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

Reimar Döffinger Reimar.Doeffinger
Tue Jan 5 08:39:19 CET 2010


On Tue, Jan 05, 2010 at 08:19:28AM +0200, Uoti Urpala wrote:
> 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.

Then the question is: why in the world is smp unsigned, and why is the
code obfuscated instead of giving it a more appropriate type?
Looking at the code I can't see even remotely any reason why smp should
be unsigned.



More information about the ffmpeg-cvslog mailing list