FS#12081 - compile warnings (out-of-bounds) in libfaad

Attached to Project: Rockbox
Opened by Andree Buschmann (Buschel) - Tuesday, 26 April 2011, 06:07 GMT
Last edited by Andree Buschmann (Buschel) - Tuesday, 26 April 2011, 21:31 GMT
Task Type Bugs
Category Codecs
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Release 3.8.1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Magnus Holmgren reported compiler warnings with GCC 4.6.0 in libfaad/decoder.c since r29778. The multiple warning starts at line 605: "warning: array subscript is above array bounds [-Warray-bounds]"

Reason for this is that I reduced MAX_CHANNELS to 2 (= stereo). The reported section in function create_channel_config() accesses channel_position[] at too large indices.

I reviewed the code and did some changes:
1) comment create_channel_config() as this is only used to set variables which are not used later
2) let NeAACDecInit() and NeAACDecInit2() return an error if more than MAX_CHANNELS channels are recognized
This task depends upon

Closed by  Andree Buschmann (Buschel)
Tuesday, 26 April 2011, 21:31 GMT
Reason for closing:  Accepted
Additional comments about closing:  Validated by Magnus Holmgren, submitted with r29784.
Comment by Thomas Martitz (kugel.) - Tuesday, 26 April 2011, 12:07 GMT
You don't seem to be a fan of #ifndef ROCKBOX?
Comment by Andree Buschmann (Buschel) - Tuesday, 26 April 2011, 17:42 GMT
No. And as our libfaad-implementation has already been altered quite a lot I see no reason in keeping it syncable until we do not switch to another implementation (e.g. ffmpeg or google).