decoder/ffmpeg: fix crash on out-of-memory
Fixes regression by commit 7c8038e
This commit is contained in:
parent
e8564b4c90
commit
2dfe2fb22c
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user