/* 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;