ffmpeg | branch: master | Paul B Mahol <one...@gmail.com> | Wed May 29 10:57:18 
2019 +0200| [02333fe394f0c15b1e8bbd3399316578ee8c2334] | committer: Paul B Mahol

avformat/gif: abort early if nothing was written yet

Fixes crash when writting trailer without any previous packets.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=02333fe394f0c15b1e8bbd3399316578ee8c2334
---

 libavformat/gif.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/gif.c b/libavformat/gif.c
index 7916ba1e6b..e125d386bd 100644
--- a/libavformat/gif.c
+++ b/libavformat/gif.c
@@ -174,6 +174,9 @@ static int gif_write_trailer(AVFormatContext *s)
     GIFContext *gif = s->priv_data;
     AVIOContext *pb = s->pb;
 
+    if (!gif->prev_pkt)
+        return AVERROR(EINVAL);
+
     gif_write_packet(s, NULL);
 
     if (!gif->have_end)

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

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

Reply via email to