[FFmpeg-devel] [PATCH 4/9] webpenc: Add missing error check

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


---
 libavformat/webpenc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/webpenc.c b/libavformat/webpenc.c
index 9fb472257d..d1ebb5fbe5 100644
--- a/libavformat/webpenc.c
+++ b/libavformat/webpenc.c
@@ -158,7 +158,9 @@ static int webp_write_packet(AVFormatContext *s, AVPacket *pkt)
         int ret;
         if ((ret = flush(s, 0, pkt->pts)) < 0)
             return ret;
-        av_packet_ref(&w->last_pkt, pkt);
+        ret = av_packet_ref(&w->last_pkt, pkt);
+        if (ret < 0)
+            return ret;
     }
     ++w->frame_count;
 
-- 
2.11.0



More information about the ffmpeg-devel mailing list