X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fgif.c;h=e4f2249083a755c54090c2db47ed822df9fd8376;hb=92769f260da8bf38956212cc6a26f98bcf80c6c7;hp=7916ba1e6b2a9bbaac3b08b6680e6218978d3ed3;hpb=6fc762b4fd2c28ef7a0689a1df5ce200e5f5948f;p=ffmpeg diff --git a/libavformat/gif.c b/libavformat/gif.c index 7916ba1e6b2..e4f2249083a 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) @@ -200,7 +203,7 @@ static const AVClass gif_muxer_class = { .option = options, }; -AVOutputFormat ff_gif_muxer = { +const AVOutputFormat ff_gif_muxer = { .name = "gif", .long_name = NULL_IF_CONFIG_SMALL("CompuServe Graphics Interchange Format (GIF)"), .mime_type = "image/gif",