From 83488a802d3e6f02faad6accbc17aa5da5795e63 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 29 Oct 2015 09:51:03 -0700 Subject: XFA: remove unsafe exif parsing code Fortunately, this could only be called with a null buffer, so none of unchecked lengths could be used. The remaining use of the CFX_/IFX_DIBAttributeEx class is as a table, so put one directly in the CFX_DIBAttribute. Fix a "register" warning along the way. R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1425983002 . --- core/include/fxcodec/fx_codec.h | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'core/include/fxcodec/fx_codec.h') diff --git a/core/include/fxcodec/fx_codec.h b/core/include/fxcodec/fx_codec.h index 3ac9434861..8eacbb2e96 100644 --- a/core/include/fxcodec/fx_codec.h +++ b/core/include/fxcodec/fx_codec.h @@ -7,6 +7,7 @@ #ifndef CORE_INCLUDE_FXCODEC_FX_CODEC_H_ #define CORE_INCLUDE_FXCODEC_FX_CODEC_H_ +#include #include #include "../../../third_party/base/nonstd_unique_ptr.h" @@ -502,37 +503,24 @@ void AdobeCMYK_to_sRGB1(uint8_t c, uint8_t& G, uint8_t& B); FX_BOOL MD5ComputeID(const void* buf, FX_DWORD dwSize, uint8_t ID[16]); + class CFX_DIBAttribute { public: CFX_DIBAttribute(); ~CFX_DIBAttribute(); int32_t m_nXDPI; - int32_t m_nYDPI; - FX_FLOAT m_fAspectRatio; - FX_WORD m_wDPIUnit; - CFX_ByteString m_strAuthor; - uint8_t m_strTime[20]; - int32_t m_nGifLeft; int32_t m_nGifTop; - FX_DWORD* m_pGifLocalPalette; - FX_DWORD m_nGifLocalPalNum; - int32_t m_nBmpCompressType; - class IFX_DIBAttributeExif* m_pExif; -}; -class IFX_DIBAttributeExif { - public: - virtual ~IFX_DIBAttributeExif(){}; - virtual FX_BOOL GetInfo(FX_WORD tag, void* val) = 0; + std::map m_Exif; }; FX_BOOL FaxSkipEOL(const uint8_t* src_buf, int bitsize, int& bitpos); -- cgit v1.2.3