From 0feba6f9ef721e4927e37da68ac27572ffae1453 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Tue, 3 Oct 2017 09:32:14 -0400 Subject: Rewrite how GIF headers are read Break up reading the signature and local screen descriptors into seperate functions. Fix a bug in how matching in the signature validation works. Move LSD value assignment to after sufficient data has been confirmed. Convert LSB to MSB methods where they were just wrong. Add unit tests for ReadData, SetInputBuffer, ReadSignature, ReadLocalScreenDescriptor, and ReadHeader. BUG=pdfium:913,chromium:770470 Change-Id: I1683b8aefc11300625b9be8087c6988549308a8f Reviewed-on: https://pdfium-review.googlesource.com/15250 Commit-Queue: dsinclair Reviewed-by: dsinclair --- core/fxcodec/gif/cfx_gif.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/fxcodec/gif/cfx_gif.cpp') diff --git a/core/fxcodec/gif/cfx_gif.cpp b/core/fxcodec/gif/cfx_gif.cpp index c3c5c85323..985a687906 100644 --- a/core/fxcodec/gif/cfx_gif.cpp +++ b/core/fxcodec/gif/cfx_gif.cpp @@ -6,6 +6,9 @@ #include "core/fxcodec/gif/cfx_gif.h" +const char* kGifSignature87 = "GIF87a"; +const char* kGifSignature89 = "GIF89a"; + static_assert(sizeof(CFX_CFX_GifImageInfo) == 9, "CFX_CFX_GifImageInfo should have a size of 9"); static_assert(sizeof(CFX_GifPalette) == 3, -- cgit v1.2.3