summaryrefslogtreecommitdiff
path: root/libavformat/webpenc.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2021-04-10 22:53:34 -0300
committerJames Almer <jamrial@gmail.com>2021-04-16 11:08:24 -0300
commit55d667d86af7d13fc5aa2b4071a5b97eb10e2da6 (patch)
treedefafb67bf489c62ac5ba049c93e2fd3c6e87256 /libavformat/webpenc.c
parent2e17b169f74bf8136385c554d36bbf4cabc6537d (diff)
downloadffmpeg-55d667d86af7d13fc5aa2b4071a5b97eb10e2da6.tar.gz
avformat/webpenc: don't assume animated webp streams will have more than one packet
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>
Diffstat (limited to 'libavformat/webpenc.c')
-rw-r--r--libavformat/webpenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/webpenc.c b/libavformat/webpenc.c
index ed8325c02d..ca4ffc4e2d 100644
--- a/libavformat/webpenc.c
+++ b/libavformat/webpenc.c
@@ -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);
}