mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-26 17:32:06 +00:00
avcodec_decode_audio: do not trust the channel layout, use the channel count.
Fixes memory corruption Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
4aed4f5846
commit
d270c32025
@ -1809,7 +1809,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
|
|||||||
* extended_data are doing it correctly */
|
* extended_data are doing it correctly */
|
||||||
if (*got_frame_ptr) {
|
if (*got_frame_ptr) {
|
||||||
planar = av_sample_fmt_is_planar(frame->format);
|
planar = av_sample_fmt_is_planar(frame->format);
|
||||||
channels = av_get_channel_layout_nb_channels(frame->channel_layout);
|
channels = frame->channels;
|
||||||
if (!(planar && channels > AV_NUM_DATA_POINTERS))
|
if (!(planar && channels > AV_NUM_DATA_POINTERS))
|
||||||
frame->extended_data = frame->data;
|
frame->extended_data = frame->data;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user