1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

fftools/ffmpeg: Fix crash when flushing non-fully setup output stream

The output stream's packet may not have been allocated
at that point. This happens when quitting in the following command line:
$ ./ffmpeg -lavfi abuffer=sample_fmt=u8:sample_rate=48000:channel_layout=stereo -f null -

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit fb215798c7)
This commit is contained in:
Andreas Rheinhardt 2021-10-08 09:47:33 +02:00 committed by James Almer
parent c989427c16
commit 4b583e5425

View File

@ -1974,6 +1974,9 @@ static void flush_encoders(void)
AVPacket *pkt = ost->pkt;
int pkt_size;
if (!pkt)
break;
switch (enc->codec_type) {
case AVMEDIA_TYPE_AUDIO:
desc = "audio";