Opened 8 years ago

Closed 7 years ago

#4343 closed defect (invalid)

ffmpeg-2.5.4 compilation warnings

Reported by: Mirraz Owned by:
Priority: normal Component: avcodec
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Building ffmpeg-2.5.4 by gcc-4.9.2 I'v got this messages:
libavcodec/atrac3plus.c:1784:46: warning: array subscript is below array bounds [-Warray-bounds]
libavcodec/libx264.c:658:35: warning: the address of ‘val’ will always evaluate as ‘true’ [-Waddress]

First one is because of strange condition in atrac3plus.c:1771

Attachments (1)

atrac3plus.c-num_quant_units-compilation-warning.patch (1.0 KB ) - added by Mirraz 7 years ago.
warning elimination patch

Download all attachments as: .zip

Change History (5)

by Mirraz, 7 years ago

warning elimination patch

comment:1 by Mirraz, 7 years ago

Propose patch that eliminates compilation warning in atrac3plus.c. Actually warning disappears only if I place accessing to trac3p_qu_to_subband[ctx->num_quant_units - 1] before calling decode_quant_wordlen(). But I changed strange condition in atrac3plus.c:1771 anyway (maybe I was wrong).

comment:2 by Timothy Gu, 7 years ago

  1. Please send patches to
  2. That warning is bogus from an IRC discussion some time ago (can't find the log…), so this patch is wrong.

comment:3 by Mirraz, 7 years ago

OK, you are right, condition is not "strange", it complies to specification which I found here: My mistake.
But this warning is not bogus, warning appears because compiler discards its suggestion about "ctx->num_quant_units" (1<=num_quant_units<=32) when "ctx" passed to "decode_quant_wordlen(gb, ctx, num_channels, avctx)" and anything can happen to fields of "ctx".
Corrected patch was sent to ffmpeg-devel.

comment:4 by Michael Niedermayer, 7 years ago

Resolution: invalid
Status: newclosed

These appear to be compiler bugs or limitations

Note: See TracTickets for help on using tickets.