]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/qtpalette.c
Changelog: add entries for the SMPTE VC-2 decoder and encoder
[ffmpeg] / libavformat / qtpalette.c
index 6544a551eb4ba16b695d317f9acdf1d613c4a6e8..666c6b73510411de75b6ee44e96af90e390e5828 100644 (file)
@@ -48,10 +48,12 @@ int ff_get_qtpalette(int codec_id, AVIOContext *pb, uint32_t *palette)
 
     /* If the depth is 1, 2, 4, or 8 bpp, file is palettized. */
     if ((bit_depth == 1 || bit_depth == 2 || bit_depth == 4 || bit_depth == 8)) {
-        int color_count, color_start, color_end;
+        uint32_t color_count, color_start, color_end;
         uint32_t a, r, g, b;
 
-        if (greyscale) {
+        /* Ignore the greyscale bit for 1-bit video and sample
+         * descriptions containing a color table. */
+        if (greyscale && bit_depth > 1 && color_table_id) {
             int color_index, color_dec;
             /* compute the greyscale palette */
             color_count = 1 << bit_depth;