summaryrefslogtreecommitdiff
path: root/core/fxcodec/gif/cfx_gifcontext.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_gifcontext.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_gifcontext.h')
-rw-r--r--core/fxcodec/gif/cfx_gifcontext.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/fxcodec/gif/cfx_gifcontext.h b/core/fxcodec/gif/cfx_gifcontext.h
index a1cffb2746..e0c5900f93 100644
--- a/core/fxcodec/gif/cfx_gifcontext.h
+++ b/core/fxcodec/gif/cfx_gifcontext.h
@@ -65,8 +65,12 @@ class CFX_GifContext : public CCodec_GifModule::Context {
uint8_t global_color_resolution_;
uint8_t img_pass_num_;
- private:
+ protected:
uint8_t* ReadData(uint8_t** des_buf_pp, uint32_t data_size);
+ CFX_GifDecodeStatus ReadGifSignature();
+ CFX_GifDecodeStatus ReadLogicalScreenDescriptor();
+
+ private:
void SaveDecodingStatus(int32_t status);
CFX_GifDecodeStatus DecodeExtension();
CFX_GifDecodeStatus DecodeImageInfo();