From 33ac88d2e5090772c04be698807620aa8bc5711e Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Mon, 2 Jul 2018 21:31:33 +0000 Subject: Access a span properly in DetectSRGB(). Change-Id: Ifeaac7141bd377daa9cf657149937be22b2aa48a Reviewed-on: https://pdfium-review.googlesource.com/36730 Reviewed-by: Tom Sepez Commit-Queue: Lei Zhang --- core/fpdfapi/page/cpdf_iccprofile.cpp | 4 ++-- 1 file 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 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 -- cgit v1.2.3