diff mbox

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

Message ID 20171017211225.3175-4-sw@jkqxz.net
State New
Headers show

Commit Message

Mark Thompson Oct. 17, 2017, 9:12 p.m. UTC
---
 libavformat/webpenc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

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;