avcodec/gif: don't honor transparency if palette changed
authorPaul B Mahol <onemda@gmail.com>
Tue, 6 Sep 2016 11:28:59 +0000 (13:28 +0200)
committerPaul B Mahol <onemda@gmail.com>
Wed, 7 Sep 2016 13:56:13 +0000 (15:56 +0200)
It generally does not work.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/gif.c

index 6af1f4a..d9c99d5 100644 (file)
@@ -83,7 +83,7 @@ static int gif_image_write_image(AVCodecContext *avctx,
     GIFContext *s = avctx->priv_data;
     int len = 0, height = avctx->height, width = avctx->width, x, y;
     int x_start = 0, y_start = 0, trans = s->transparent_index;
-    int honor_transparency = (s->flags & GF_TRANSDIFF) && s->last_frame;
+    int honor_transparency = (s->flags & GF_TRANSDIFF) && s->last_frame && !palette;
     const uint8_t *ptr;
 
     /* Crop image */