From c9e48f253d68fe7680309fa3baaac9b9b815db0f Mon Sep 17 00:00:00 2001 From: Marko Viitanen Date: Thu, 24 Jun 2021 14:48:48 +0300 Subject: [PATCH] Fix hash message with monochrome --- src/encoder_state-bitstream.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/encoder_state-bitstream.c b/src/encoder_state-bitstream.c index 371cfc3c..e150c92d 100644 --- a/src/encoder_state-bitstream.c +++ b/src/encoder_state-bitstream.c @@ -1400,7 +1400,7 @@ static void add_checksum(encoder_state_t * const state) WRITE_U(stream, 2 + num_colors * 4, 8, "size"); WRITE_U(stream, 2, 8, "hash_type"); // 2 = checksum - WRITE_U(stream, 0, 1, "dph_sei_single_component_flag"); + WRITE_U(stream, num_colors==1, 1, "dph_sei_single_component_flag"); WRITE_U(stream, 0, 7, "dph_sei_reserved_zero_7bits"); for (int i = 0; i < num_colors; ++i) { @@ -1418,7 +1418,7 @@ static void add_checksum(encoder_state_t * const state) WRITE_U(stream, 2 + num_colors * 16, 8, "size"); WRITE_U(stream, 0, 8, "hash_type"); // 0 = md5 - WRITE_U(stream, 0, 1, "dph_sei_single_component_flag"); + WRITE_U(stream, num_colors==1, 1, "dph_sei_single_component_flag"); WRITE_U(stream, 0, 7, "dph_sei_reserved_zero_7bits"); for (int i = 0; i < num_colors; ++i) {