diff mbox series

[FFmpeg-devel] avcodec/gifenc: Actually use the shrunk palette

Message ID 20210310152055.40622-1-derek.buitenhuis@gmail.com
State Accepted
Commit e690aa6a8dfa9a04c260af0eacc4c2978ad1a5fc
Headers show
Series [FFmpeg-devel] avcodec/gifenc: Actually use the shrunk palette | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Derek Buitenhuis March 10, 2021, 3:20 p.m. UTC
I have no idea how nobody, including myself, noticed this.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
---
 libavcodec/gif.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Derek Buitenhuis March 11, 2021, 8:32 p.m. UTC | #1
On 10/03/2021 15:20, Derek Buitenhuis wrote:
> I have no idea how nobody, including myself, noticed this.
> 
> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
> ---
>  libavcodec/gif.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Will push in a few hours if nobody objects.

- Derek
diff mbox series

Patch

diff --git a/libavcodec/gif.c b/libavcodec/gif.c
index 938bc0e928..cafd93e190 100644
--- a/libavcodec/gif.c
+++ b/libavcodec/gif.c
@@ -383,13 +383,12 @@  static int gif_image_write_image(AVCodecContext *avctx,
     bytestream_put_le16(bytestream, height);
 
     if (palette || !s->use_global_palette) {
-        const uint32_t *pal = palette ? palette : s->palette;
         unsigned pow2_count = av_log2(shrunk_palette_count - 1);
         unsigned i;
 
         bytestream_put_byte(bytestream, 1<<7 | pow2_count); /* flags */
         for (i = 0; i < 1 << (pow2_count + 1); i++) {
-            const uint32_t v = pal[i];
+            const uint32_t v = shrunk_palette[i];
             bytestream_put_be24(bytestream, v);
         }
     } else {