[FFmpeg-devel] [PATCH] avformat/atrac3plus: fix compilation warning
Ilya Gordeev
mirraz1 at rambler.ru
Wed Apr 22 23:41:39 CEST 2015
Compiling ffmpeg I'v got this message:
libavcodec/atrac3plus.c:1784:46: warning: array subscript is below array bounds [-Warray-bounds]
It's 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".
Warning disappears if we place accessing to "trac3p_qu_to_subband[ctx->num_quant_units - 1]" before calling "decode_quant_wordlen(gb, ctx, num_channels, avctx)". Patch is in attachment.
See also ticket #4343 (there patch is wrong!)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-avformat-atrac3plus-fix-compilation-warning.patch
Type: text/x-patch
Size: 1173 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150423/559cb3ab/attachment.bin>
More information about the ffmpeg-devel
mailing list