summaryrefslogtreecommitdiff
path: root/core/fxcodec/gif/cfx_gif.h
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-10-03 09:32:14 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-10-03 13:53:21 +0000
commit0feba6f9ef721e4927e37da68ac27572ffae1453 (patch)
tree9e5cfef2691bcd8e439bca9175c8197fbd946e33 /core/fxcodec/gif/cfx_gif.h
parentc2ae41abd16aef062fee878160aa18457d2118a7 (diff)
downloadpdfium-0feba6f9ef721e4927e37da68ac27572ffae1453.tar.xz
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 <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcodec/gif/cfx_gif.h')
-rw-r--r--core/fxcodec/gif/cfx_gif.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/fxcodec/gif/cfx_gif.h b/core/fxcodec/gif/cfx_gif.h
index e9eb5c4054..ab8278ecd2 100644
--- a/core/fxcodec/gif/cfx_gif.h
+++ b/core/fxcodec/gif/cfx_gif.h
@@ -12,7 +12,9 @@
class CFX_GifContext;
-#define GIF_SIGNATURE "GIF"
+extern const char* kGifSignature87;
+extern const char* kGifSignature89;
+
#define GIF_SIG_EXTENSION 0x21
#define GIF_SIG_IMAGE 0x2C
#define GIF_SIG_TRAILER 0x3B
@@ -49,10 +51,7 @@ typedef struct {
uint8_t local_pal : 1;
} CFX_GifLocalFlags;
-typedef struct {
- char signature[3];
- char version[3];
-} CFX_GifHeader;
+typedef struct { char signature[6]; } CFX_GifHeader;
typedef struct {
uint16_t width;