Return failure on comment mismatch in CLI decompression

The final comment verification check in DecompressFile() detects when
comment_state is not COMMENT_OK but unconditionally returns BROTLI_TRUE.
This causes the -C (comment verification) flag to accept streams with
missing or mismatched comments, keeping the output file and exiting 0.

Add the missing return BROTLI_FALSE inside the mismatch branch so that
comment verification failures are properly propagated to the caller.
This commit is contained in:
Your Name
2026-04-11 16:37:53 +05:30
parent 5583858f76
commit 2868c3ac9b

View File

@@ -1293,6 +1293,7 @@ static BROTLI_BOOL DecompressFile(Context* context) {
if (context->verbosity > 0) {
fprintf(stderr, "reason: comment mismatch\n");
}
return BROTLI_FALSE;
}
return BROTLI_TRUE;
}