]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/gif: fix disposal method for first frame and transparent gifs
authorPaul B Mahol <onemda@gmail.com>
Sun, 23 Aug 2020 13:05:24 +0000 (15:05 +0200)
committerPaul B Mahol <onemda@gmail.com>
Sun, 23 Aug 2020 14:21:56 +0000 (16:21 +0200)
Fixes #7902

libavcodec/gif.c

index e92dfa65d7c4bcf0610d222fc6b7fe51211a5df1..65a76cfde434f02f70d4deb26d33111bbfd4b477 100644 (file)
@@ -267,7 +267,7 @@ static int gif_image_write_image(AVCodecContext *avctx,
     int bcid = -1, honor_transparency = (s->flags & GF_TRANSDIFF) && s->last_frame && !palette;
     const uint8_t *ptr;
 
-    if (!s->image && avctx->frame_number && is_image_translucent(avctx, buf, linesize)) {
+    if (!s->image && is_image_translucent(avctx, buf, linesize)) {
         gif_crop_translucent(avctx, buf, linesize, &width, &height, &x_start, &y_start);
         honor_transparency = 0;
         disposal = GCE_DISPOSAL_BACKGROUND;