summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-04-10 16:56:14 +0900
committerChris Michael <cp.michael@samsung.com>2017-04-11 11:51:50 -0400
commit60e2a77e9e696a4ff11a6af00ee6a531ae2f7eef (patch)
tree8136a75cff75a00fcee9d741f86b6175f9fad149
parent4a1f963b811045ad546d67be0c3d09759a288359 (diff)
evas filters: Fix a rare crash in text render (SW)
There are reports of crashes when y < 0. This case seems abnormal in case of filters, as I don't know how to reproduce it, but it's happened. Thanks Youngbok Shin for the report. @fix
-rw-r--r--src/lib/evas/common/evas_font_compress.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/lib/evas/common/evas_font_compress.c b/src/lib/evas/common/evas_font_compress.c
index 7788ba52ea..e923e17251 100644
--- a/src/lib/evas/common/evas_font_compress.c
+++ b/src/lib/evas/common/evas_font_compress.c
@@ -508,11 +508,24 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg,
508 // FIXME: Font draw not optimized for Alpha targets! SLOW! 508 // FIXME: Font draw not optimized for Alpha targets! SLOW!
509 // This is not pretty :) 509 // This is not pretty :)
510 510
511 DATA8 *dst8 = dst_image->image.data8 + x + (y * dst_pitch);
512 Alpha_Gfx_Func func; 511 Alpha_Gfx_Func func;
513 DATA8 *src8; 512 DATA8 *src8, *dst8;
514 int row; 513 int row;
515 514
515 if (EINA_UNLIKELY(x < 0))
516 {
517 x1 += (-x);
518 x = 0;
519 if ((x2 - x1) <= 0) return;
520 }
521 if (EINA_UNLIKELY(y < 0))
522 {
523 y1 += (-y);
524 y = 0;
525 if ((y2 - y1) <= 0) return;
526 }
527
528 dst8 = dst_image->image.data8 + x + (y * dst_pitch);
516 func = efl_draw_alpha_func_get(dc->render_op, EINA_FALSE); 529 func = efl_draw_alpha_func_get(dc->render_op, EINA_FALSE);
517 src8 = evas_common_font_glyph_uncompress(fg, NULL, NULL); 530 src8 = evas_common_font_glyph_uncompress(fg, NULL, NULL);
518 if (!src8) return; 531 if (!src8) return;