]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/gif.c
avcodec: Constify AVCodecs
[ffmpeg] / libavcodec / gif.c
index 938bc0e928e4c685fcb6ccaadd48c799a5ef75bd..f3ee15c2ac8a55b84aa4f76fb35a0254805a56c5 100644 (file)
@@ -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 {
@@ -552,7 +551,7 @@ static const AVClass gif_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-AVCodec ff_gif_encoder = {
+const AVCodec ff_gif_encoder = {
     .name           = "gif",
     .long_name      = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"),
     .type           = AVMEDIA_TYPE_VIDEO,