summaryrefslogtreecommitdiff
path: root/libavcodec/gif.c
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2021-03-10 15:18:41 +0000
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2021-03-11 21:41:52 +0000
commite690aa6a8dfa9a04c260af0eacc4c2978ad1a5fc (patch)
tree52581271ded22c4fee74d3c2e6a7b0ba5835e3fa /libavcodec/gif.c
parent99042c2bf6cc79006036502a6abbec5e51f73673 (diff)
downloadffmpeg-e690aa6a8dfa9a04c260af0eacc4c2978ad1a5fc.tar.gz
avcodec/gifenc: Actually use the shrunk palette
I have no idea how nobody, including myself, noticed this. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavcodec/gif.c')
-rw-r--r--libavcodec/gif.c3
1 files changed, 1 insertions, 2 deletions
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 {