[FFmpeg-devel] [PATCH 3/9] gif: Add missing error check

Mark Thompson sw at jkqxz.net
Wed Oct 18 00:12:19 EEST 2017


---
 libavformat/gif.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavformat/gif.c b/libavformat/gif.c
index 01d98a27b0..3336152c06 100644
--- a/libavformat/gif.c
+++ b/libavformat/gif.c
@@ -174,8 +174,12 @@ static int flush_packet(AVFormatContext *s, AVPacket *new)
     avio_write(pb, pkt->data, pkt->size);
 
     av_packet_unref(gif->prev_pkt);
-    if (new)
-        av_packet_ref(gif->prev_pkt, new);
+    if (new) {
+        int ret;
+        ret = av_packet_ref(gif->prev_pkt, new);
+        if (ret < 0)
+            return ret;
+    }
 
     return 0;
 }
-- 
2.11.0



More information about the ffmpeg-devel mailing list