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(-)

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

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to