diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/decoder/plugins/FfmpegDecoderPlugin.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx index e7f2ebfb0..60c49800d 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -340,15 +340,19 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is, break; } - uint8_t *output_buffer; + uint8_t *output_buffer = nullptr; int audio_size = 0; if (got_frame) { audio_size = copy_interleave_frame(codec_context, frame, &output_buffer, buffer, buffer_size); - if (audio_size < 0) - len = audio_size; + if (audio_size < 0) { + /* this must be a serious error, + e.g. OOM */ + LogFfmpegError(audio_size); + return DecoderCommand::STOP; + } } packet2.data += len; |