decoder/ffmpeg: check for av_samples_get_buffer_size() errors

Fixes potential nullptr dereference.
This commit is contained in:
Max Kellermann 2014-01-14 23:16:07 +01:00
parent 56f082c9d4
commit 5b6bb114ad

View File

@ -223,6 +223,9 @@ copy_interleave_frame(const AVCodecContext *codec_context,
codec_context->channels,
frame->nb_samples,
codec_context->sample_fmt, 1);
if (data_size <= 0)
return data_size;
if (av_sample_fmt_is_planar(codec_context->sample_fmt) &&
codec_context->channels > 1) {
if(*global_buffer_size < data_size) {