aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-10-11 12:32:02 +0200
committerAnton Khirnov <anton@khirnov.net>2022-10-18 13:57:42 +0200
commit072e3f710e836077defaca424bdad0b69f039fb5 (patch)
tree7d7e4a86185a42cd6f5cc0957d5252b3cbb5ff5d
parent3141dbb7adf1e2bd5b9ff700312d7732c958b8df (diff)
downloadffmpeg-072e3f710e836077defaca424bdad0b69f039fb5.tar.gz
fftools/ffmpeg_mux: do not unref a NULL packet
The packet submitted to of_submit_packet() may be NULL to signal EOF.
-rw-r--r--fftools/ffmpeg_mux.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c
index 395f7cc89f..a6877ae5ec 100644
--- a/fftools/ffmpeg_mux.c
+++ b/fftools/ffmpeg_mux.c
@@ -329,7 +329,8 @@ int of_submit_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost)
/* the muxer is not initialized yet, buffer the packet */
ret = queue_packet(of, ost, pkt);
if (ret < 0) {
- av_packet_unref(pkt);
+ if (pkt)
+ av_packet_unref(pkt);
return ret;
}
}