Fulfill a TODO in cpdf_dib.cpp
The BPP value in CalculateBitsPerPixel() is never 0, because the only
caller checks the bit-per-component and component count values to make
sure they are not 0.
Change-Id: Ia00f3b25eebde0b0b2d535b32363a8db167df8c0
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/113333
Reviewed-by: Nigi <nigi@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/page/cpdf_dib.cpp b/core/fpdfapi/page/cpdf_dib.cpp
index 657cf16..cb8de1c 100644
--- a/core/fpdfapi/page/cpdf_dib.cpp
+++ b/core/fpdfapi/page/cpdf_dib.cpp
@@ -89,8 +89,8 @@
}
int CalculateBitsPerPixel(uint32_t bpc, uint32_t comps) {
- // TODO(thestig): Can |bpp| be 0 here? Add an DCHECK() or handle it?
uint32_t bpp = bpc * comps;
+ CHECK(bpp);
if (bpp == 1)
return 1;
if (bpp <= 8)