Opened 5 years ago

Closed 4 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

Description

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 4 years ago.
warning elimination patch

Download all attachments as: .zip

Change History (5)

Changed 4 years ago by Mirraz

warning elimination patch

comment:1 Changed 4 years ago by Mirraz

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 Changed 4 years ago by Timothy_Gu

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

comment:3 Changed 4 years ago by Mirraz

OK, you are right, condition is not "strange", it complies to specification which I found here: http://wiki.multimedia.cx/index.php?title=ATRAC3plus. 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 Changed 4 years ago by michael

  • Resolution set to invalid
  • Status changed from new to closed

These appear to be compiler bugs or limitations

Note: See TracTickets for help on using tickets.