]> git.sesse.net Git - ffmpeg/commitdiff
avformat/webpenc: don't assume animated webp streams will have more than one packet
authorJames Almer <jamrial@gmail.com>
Sun, 11 Apr 2021 01:53:34 +0000 (22:53 -0300)
committerJames Almer <jamrial@gmail.com>
Fri, 16 Apr 2021 14:08:24 +0000 (11:08 -0300)
The libwebp_animencoder returns a single packet with the entire animated
stream, as that's what the external library produces. As such, only ensure the
stream was produced by said encoder (or propagated by a demuxer, once support
is added) when attempting to write the requested loop value.

Fixes ticket #9179.

Signed-off-by: James Almer <jamrial@gmail.com>
libavformat/webpenc.c

index ed8325c02d7423791a2eded40c9fdc5c9f2fceec..ca4ffc4e2dd0abaed32ede79e4b32e31aa572352 100644 (file)
@@ -172,7 +172,7 @@ static int webp_write_trailer(AVFormatContext *s)
     WebpContext *w = s->priv_data;
 
     if (w->using_webp_anim_encoder) {
-        if ((w->frame_count > 1) && w->loop) {  // Write loop count.
+        if (w->loop) {  // Write loop count.
             avio_seek(s->pb, 42, SEEK_SET);
             avio_wl16(s->pb, w->loop);
         }