mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-06 15:49:50 +08:00
Merge remote-tracking branch 'qatar/master'
* qatar/master: (58 commits) amrnbdec: check frame size before decoding. cscd: use negative error values to indicate decode_init() failures. h264: prevent overreads in intra PCM decoding. FATE: do not decode audio in the nuv test. dxa: set audio stream time base using the sample rate psx-str: do not allow seeking by bytes asfdec: Do not set AVCodecContext.frame_size vqf: set packet parameters after av_new_packet() mpegaudiodec: use DSPUtil.butterflies_float(). FATE: add mp3 test for sample that exhibited false overreads fate: add cdxl test for bit line plane arrangement vmnc: return error on decode_init() failure. libvorbis: add/update error messages libvorbis: use AVFifoBuffer for output packet buffer libvorbis: remove unneeded e_o_s check libvorbis: check return values for functions that can return errors libvorbis: use float input instead of s16 libvorbis: do not flush libvorbis analysis if dsp state was not initialized libvorbis: use VBR by default, with default quality of 3 libvorbis: fix use of minrate/maxrate AVOptions ... Conflicts: Changelog doc/APIchanges libavcodec/avcodec.h libavcodec/dpxenc.c libavcodec/libvorbis.c libavcodec/vmnc.c libavformat/asfdec.c libavformat/id3v2enc.c libavformat/internal.h libavformat/mp3enc.c libavformat/utils.c libavformat/version.h libswscale/utils.c tests/fate/video.mak tests/ref/fate/nuv tests/ref/fate/prores-alpha tests/ref/lavf/ffm tests/ref/vsynth1/prores tests/ref/vsynth2/prores Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@ -200,6 +200,10 @@ static enum Mode unpack_bitstream(AMRContext *p, const uint8_t *buf,
|
||||
p->bad_frame_indicator = !get_bits1(&gb); // quality bit
|
||||
skip_bits(&gb, 2); // two padding bits
|
||||
|
||||
if (mode >= N_MODES || buf_size < frame_sizes_nb[mode] + 1) {
|
||||
return NO_DATA;
|
||||
}
|
||||
|
||||
if (mode < MODE_DTX)
|
||||
ff_amr_bit_reorder((uint16_t *) &p->frame, sizeof(AMRNBFrame), buf + 1,
|
||||
amr_unpacking_bitmaps_per_mode[mode]);
|
||||
@ -947,6 +951,10 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data,
|
||||
buf_out = (float *)p->avframe.data[0];
|
||||
|
||||
p->cur_frame_mode = unpack_bitstream(p, buf, buf_size);
|
||||
if (p->cur_frame_mode == NO_DATA) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Corrupt bitstream\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (p->cur_frame_mode == MODE_DTX) {
|
||||
av_log_missing_feature(avctx, "dtx mode", 0);
|
||||
av_log(avctx, AV_LOG_INFO, "Note: libopencore_amrnb supports dtx\n");
|
||||
|
Reference in New Issue
Block a user