You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +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>
This commit is contained in:
@@ -1981,6 +1981,9 @@ static void flush_encoders(void)
|
|||||||
AVPacket *pkt = ost->pkt;
|
AVPacket *pkt = ost->pkt;
|
||||||
int pkt_size;
|
int pkt_size;
|
||||||
|
|
||||||
|
if (!pkt)
|
||||||
|
break;
|
||||||
|
|
||||||
switch (enc->codec_type) {
|
switch (enc->codec_type) {
|
||||||
case AVMEDIA_TYPE_AUDIO:
|
case AVMEDIA_TYPE_AUDIO:
|
||||||
desc = "audio";
|
desc = "audio";
|
||||||
|
Reference in New Issue
Block a user