Commit 5b6bb114 authored by Max Kellermann's avatar Max Kellermann

decoder/ffmpeg: check for av_samples_get_buffer_size() errors

Fixes potential nullptr dereference.
parent 56f082c9
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment