Fix an assert in SkBmpCodec::ReadHeader
Bug: chromium:897389
The comment seems to imply that infoBytesRemaining should be at least 52
(inclusive). This matches the code below (we read 4 bytes starting at
offset 48). In addition, since this must be one of
kInfoV3_BmpHeaderType, kInfoV4_BmpHeaderType, or kInfoV5_BmpHeaderType,
It is valid for infoBytesRemaining to be 52 (and no less).
Change-Id: I330460f1eb5d372feb622588e26ea3f3a8ddad1e
Reviewed-on: https://skia-review.googlesource.com/c/164604
Commit-Queue: Leon Scroggins <scroggo@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
diff --git a/src/codec/SkBmpCodec.cpp b/src/codec/SkBmpCodec.cpp
index e20e6c9..e13dccb 100644
--- a/src/codec/SkBmpCodec.cpp
+++ b/src/codec/SkBmpCodec.cpp
@@ -374,7 +374,7 @@
//
// Header types are matched based on size. If the header is
// V3+, we are guaranteed to be able to read at least this size.
- SkASSERT(infoBytesRemaining > 52);
+ SkASSERT(infoBytesRemaining >= 52);
inputMasks.alpha = get_int(iBuffer.get(), 48);
break;
case kOS2VX_BmpHeaderType: