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:
Mike Blumenkrantz 2019-05-13 11:44:27 -04:00
parent 20cefc8db2
commit 01ce5a1249
1 changed files with 3 additions and 3 deletions

View File

@ -140,9 +140,6 @@ _evas_common_scale_rgba_sample_scale_mask(int y,
DATA32 *buf, *dst_ptr;
int x;
/* a scanline buffer */
buf = alloca(dst_clip_w * sizeof(DATA32));
/* clamp/map to mask geometry */
if (EINA_UNLIKELY(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))
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;
for (; y < dst_clip_h; y++)
{