forked from enlightenment/efl
evas/scale_sample: call alloca for the scanline buffer after clamping width
Summary: this is already a risky call for larger scanlines, so use the clamped value to further reduce the chance of blowing out the stack Depends on D8839 Reviewers: cedric, segfaultxavi Reviewed By: segfaultxavi Subscribers: segfaultxavi, #reviewers, #committers Tags: #efl_rendering Differential Revision: https://phab.enlightenment.org/D8840
This commit is contained in:
parent
20cefc8db2
commit
01ce5a1249
|
@ -140,9 +140,6 @@ _evas_common_scale_rgba_sample_scale_mask(int y,
|
||||||
DATA32 *buf, *dst_ptr;
|
DATA32 *buf, *dst_ptr;
|
||||||
int x;
|
int x;
|
||||||
|
|
||||||
/* a scanline buffer */
|
|
||||||
buf = alloca(dst_clip_w * sizeof(DATA32));
|
|
||||||
|
|
||||||
/* clamp/map to mask geometry */
|
/* clamp/map to mask geometry */
|
||||||
if (EINA_UNLIKELY(dst_clip_x < mask_x))
|
if (EINA_UNLIKELY(dst_clip_x < mask_x))
|
||||||
dst_clip_x = mask_x;
|
dst_clip_x = mask_x;
|
||||||
|
@ -153,6 +150,9 @@ _evas_common_scale_rgba_sample_scale_mask(int y,
|
||||||
if (EINA_UNLIKELY(dst_clip_y + dst_clip_h > mask_y + (int)mask_ie->cache_entry.h))
|
if (EINA_UNLIKELY(dst_clip_y + dst_clip_h > mask_y + (int)mask_ie->cache_entry.h))
|
||||||
dst_clip_h = mask_y + mask_ie->cache_entry.h - dst_clip_y;
|
dst_clip_h = mask_y + mask_ie->cache_entry.h - dst_clip_y;
|
||||||
|
|
||||||
|
/* a scanline buffer */
|
||||||
|
buf = alloca(dst_clip_w * sizeof(DATA32));
|
||||||
|
|
||||||
dptr = dptr + dst_w * y;
|
dptr = dptr + dst_w * y;
|
||||||
for (; y < dst_clip_h; y++)
|
for (; y < dst_clip_h; y++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue