summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-07-02 21:31:33 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-02 21:31:33 +0000
commit33ac88d2e5090772c04be698807620aa8bc5711e (patch)
treecd0868f05755e28c81c5d0359251cac09077f9aa /core/fpdfapi
parent7695dd0f9f5a5a91a0fdfc723edfe706a39c87f4 (diff)
downloadpdfium-33ac88d2e5090772c04be698807620aa8bc5711e.tar.xz
Access a span properly in DetectSRGB().
Change-Id: Ifeaac7141bd377daa9cf657149937be22b2aa48a Reviewed-on: https://pdfium-review.googlesource.com/36730 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/page/cpdf_iccprofile.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/fpdfapi/page/cpdf_iccprofile.cpp b/core/fpdfapi/page/cpdf_iccprofile.cpp
index 94270b110b..0d6050790c 100644
--- a/core/fpdfapi/page/cpdf_iccprofile.cpp
+++ b/core/fpdfapi/page/cpdf_iccprofile.cpp
@@ -13,8 +13,8 @@
namespace {
bool DetectSRGB(pdfium::span<const uint8_t> span) {
- return span.size() == 3144 &&
- memcmp(span.data() + 0x190, "sRGB IEC61966-2.1", 17) == 0;
+ static const char kSRGB[] = "sRGB IEC61966-2.1";
+ return span.size() == 3144 && memcmp(&span[400], kSRGB, strlen(kSRGB)) == 0;
}
} // namespace