Commit 02333fe3 authored by Paul B Mahol's avatar Paul B Mahol

avformat/gif: abort early if nothing was written yet

Fixes crash when writting trailer without any previous packets.
parent d903c09d
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment