[FFmpeg-trac] #1890(avcodec:new): avpriv_mpeg4audio_sample_rates vector size not correct
FFmpeg
trac at avcodec.org
Tue Nov 6 10:39:09 CET 2012
#1890: avpriv_mpeg4audio_sample_rates vector size not correct
------------------------------------+--------------------------------------
Reporter: dellabetta | Type: defect
Status: new | Priority: normal
Component: avcodec | Version: git-master
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
------------------------------------+--------------------------------------
in mpeg4audio.c
const int avpriv_mpeg4audio_sample_rates[16] = {
96000, 88200, 64000, 48000, 44100, 32000,
24000, 22050, 16000, 12000, 11025, 8000, 7350
};
but there are only 13 values!
in aacenc.c, the code
for (i = 0; i < 16; i++)
if (avctx->sample_rate == avpriv_mpeg4audio_sample_rates[i])
break;
seems faulty.
IMHO avpriv_mpeg4audio_sample_rates should become
const int avpriv_mpeg4audio_sample_rates[13] = {
96000, 88200, 64000, 48000, 44100, 32000,
24000, 22050, 16000, 12000, 11025, 8000, 7350
};
and in aacenc.c you should safely write something like
for (i = 0; i < FF_ARRAY_ELEMS(avpriv_mpeg4audio_sample_rates); i++)
...
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/1890>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list