summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2/JBig2_Image.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_Image.h')
-rw-r--r--core/fxcodec/jbig2/JBig2_Image.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/fxcodec/jbig2/JBig2_Image.h b/core/fxcodec/jbig2/JBig2_Image.h
index b1b1489506..b61ce84e0f 100644
--- a/core/fxcodec/jbig2/JBig2_Image.h
+++ b/core/fxcodec/jbig2/JBig2_Image.h
@@ -40,8 +40,11 @@ class CJBig2_Image {
int GetPixel(int32_t x, int32_t y) const;
void SetPixel(int32_t x, int32_t y, int bVal);
- uint8_t* GetLine(int32_t y) const;
uint8_t* GetLineUnsafe(int32_t y) const { return data() + y * m_nStride; }
+ uint8_t* GetLine(int32_t y) const {
+ return (y >= 0 && y < m_nHeight) ? GetLineUnsafe(y) : nullptr;
+ }
+
void CopyLine(int32_t hTo, int32_t hFrom);
void Fill(bool v);