diff mbox series

[FFmpeg-devel,01/13] fftools/ffmpeg_mux: do not unref a NULL packet

Message ID 20221013134904.10104-1-anton@khirnov.net
State Accepted
Commit 072e3f710e836077defaca424bdad0b69f039fb5
Headers show
Series [FFmpeg-devel,01/13] fftools/ffmpeg_mux: do not unref a NULL packet | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov Oct. 13, 2022, 1:48 p.m. UTC
The packet submitted to of_submit_packet() may be NULL to signal EOF.
---
 fftools/ffmpeg_mux.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Anton Khirnov Oct. 17, 2022, 8:49 a.m. UTC | #1
Will push the set tomorrow if nobody wants to comment.
diff mbox series

Patch

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;
         }
     }