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

Måns Rullgård mans
Tue Jan 5 12:59:53 CET 2010


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

> Am 05.01.10 00:30, schrieb Thilo Borgmann:
>> Hi,
>> 
>> 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)?
>> 
>> I'm sorry, my svn still seems to be broken and produces unusable patches
>> (%ld...). Nevertheless I can apply them if the workaround is ok.
>> 
>
> Some artifacts left in als_data.h. Ignore the old patch, updated patch
> attached.
>
> -Thilo
>
> Index: libavcodec/alsdec.c
> ===================================================================
> --- libavcodec/alsdec.c	(Revision 21025)
> +++ libavcodec/alsdec.c	(Arbeitskopie)
> @@ -%ld,%ld +%ld,%ld @@
>              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)));

Those two statements should be exactly equivalent.  That's how [] is
defined by the standard.  Please explain why this fixes anything at all.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list