diff options
author | Paul B Mahol <onemda@gmail.com> | 2019-05-29 10:57:18 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2019-05-29 10:57:18 +0200 |
commit | 02333fe394f0c15b1e8bbd3399316578ee8c2334 (patch) | |
tree | 41f27d554d6356d9b689101dfb0b5b8bf3e1d0d8 | |
parent | d903c09d9a5c641223f0810d24161520e977544a (diff) | |
download | ffmpeg-02333fe394f0c15b1e8bbd3399316578ee8c2334.tar.gz |
avformat/gif: abort early if nothing was written yet
Fixes crash when writting trailer without any previous packets.
-rw-r--r-- | libavformat/gif.c | 3 |
1 files changed, 3 insertions, 0 deletions
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) |