zmike pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=01ce5a1249fee516d5cfdff0408221920ac26643

commit 01ce5a1249fee516d5cfdff0408221920ac26643
Author: Mike Blumenkrantz <zm...@samsung.com>
Date:   Mon May 13 11:44:27 2019 -0400

    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
---
 src/lib/evas/common/evas_scale_sample.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/lib/evas/common/evas_scale_sample.c 
b/src/lib/evas/common/evas_scale_sample.c
index 6fc54de00b..d043ba3414 100644
--- a/src/lib/evas/common/evas_scale_sample.c
+++ b/src/lib/evas/common/evas_scale_sample.c
@@ -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++)
      {

-- 


Reply via email to