summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2/JBig2_Image.h
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-11-07 19:16:35 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-07 19:16:35 +0000
commit826f2223fb0414144d7a627d5d0264da1a5ce82e (patch)
tree14c41a5d1c9ad0262a189f03c80745bb5e0356af /core/fxcodec/jbig2/JBig2_Image.h
parentc9653fb272dd2d006a2725c42b5a36ffafb099a7 (diff)
downloadpdfium-826f2223fb0414144d7a627d5d0264da1a5ce82e.tar.xz
Use MaybeOwned in CJBig2_Image
Change-Id: Id53cbb8c95f6eb929f6e4eb57333daa24f1b776f Reviewed-on: https://pdfium-review.googlesource.com/18010 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_Image.h')
-rw-r--r--core/fxcodec/jbig2/JBig2_Image.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/fxcodec/jbig2/JBig2_Image.h b/core/fxcodec/jbig2/JBig2_Image.h
index 1f418fb7e2..c0980407db 100644
--- a/core/fxcodec/jbig2/JBig2_Image.h
+++ b/core/fxcodec/jbig2/JBig2_Image.h
@@ -10,6 +10,7 @@
#include <memory>
#include "core/fxcodec/jbig2/JBig2_Define.h"
+#include "core/fxcrt/maybe_owned.h"
struct FX_RECT;
@@ -31,6 +32,7 @@ class CJBig2_Image {
int32_t width() const { return m_nWidth; }
int32_t height() const { return m_nHeight; }
int32_t stride() const { return m_nStride; }
+ uint8_t* data() const { return m_pData.Get(); }
int getPixel(int32_t x, int32_t y) const;
int32_t setPixel(int32_t x, int32_t y, int bVal);
@@ -68,13 +70,12 @@ class CJBig2_Image {
int32_t h);
void expand(int32_t h, bool v);
- uint8_t* m_pData;
private:
+ MaybeOwned<uint8_t, FxFreeDeleter> m_pData;
int32_t m_nWidth; // 1-bit pixels
int32_t m_nHeight; // lines
int32_t m_nStride; // bytes
- bool m_bOwnsBuffer;
};
#endif // CORE_FXCODEC_JBIG2_JBIG2_IMAGE_H_