Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b546822

Browse files
authored
Merge pull request #8572 from QuLogic/big-image-crash
FIX: Upcast image stride to 64-bit when multiplying values.
2 parents c192e37 + 46592b2 commit b546822

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

extern/agg24-svn/include/agg_rendering_buffer.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace agg
6262
m_stride = stride;
6363
if(stride < 0)
6464
{
65-
m_start = m_buf - int(height - 1) * stride;
65+
m_start = m_buf - (AGG_INT64)(height - 1) * stride;
6666
}
6767
}
6868

@@ -80,10 +80,10 @@ namespace agg
8080
//--------------------------------------------------------------------
8181
AGG_INLINE T* row_ptr(int, int y, unsigned)
8282
{
83-
return m_start + y * m_stride;
83+
return m_start + y * (AGG_INT64)m_stride;
8484
}
85-
AGG_INLINE T* row_ptr(int y) { return m_start + y * m_stride; }
86-
AGG_INLINE const T* row_ptr(int y) const { return m_start + y * m_stride; }
85+
AGG_INLINE T* row_ptr(int y) { return m_start + y * (AGG_INT64)m_stride; }
86+
AGG_INLINE const T* row_ptr(int y) const { return m_start + y * (AGG_INT64)m_stride; }
8787
AGG_INLINE row_data row (int y) const
8888
{
8989
return row_data(0, m_width-1, row_ptr(y));
@@ -181,7 +181,7 @@ namespace agg
181181

182182
if(stride < 0)
183183
{
184-
row_ptr = m_buf - int(height - 1) * stride;
184+
row_ptr = m_buf - (AGG_INT64)(height - 1) * stride;
185185
}
186186

187187
T** rows = &m_rows[0];

0 commit comments

Comments
 (0)