Evas: Fix seg fault in the esvg loader, latest code is required, and enable it on Windows.
SVN revision: 75942
This commit is contained in:
parent
72010bf66d
commit
0854fe7aba
|
@ -1003,3 +1003,8 @@
|
||||||
2012-08-31 Christophe Sadoine
|
2012-08-31 Christophe Sadoine
|
||||||
|
|
||||||
* Added a function: evas_map_util_quat_rotate().
|
* Added a function: evas_map_util_quat_rotate().
|
||||||
|
|
||||||
|
2012-09-02 Vincent Torri
|
||||||
|
|
||||||
|
* Fix seg fault in the esvg loader, latest code is required, and
|
||||||
|
enable it on Windows.
|
||||||
|
|
|
@ -7,6 +7,9 @@ Improvements:
|
||||||
|
|
||||||
* Function to rotate an evas map with a quaternion: evas_map_util_quat_rotate().
|
* Function to rotate an evas map with a quaternion: evas_map_util_quat_rotate().
|
||||||
|
|
||||||
|
Fixes:
|
||||||
|
* Fix segmentation fault with the esvg loader.
|
||||||
|
|
||||||
Evas 1.7.0
|
Evas 1.7.0
|
||||||
|
|
||||||
Changes since Evas 1.2.0:
|
Changes since Evas 1.2.0:
|
||||||
|
|
|
@ -146,7 +146,7 @@ case "$host_os" in
|
||||||
want_evas_engine_software_ddraw="yes"
|
want_evas_engine_software_ddraw="yes"
|
||||||
want_evas_engine_direct3d="yes"
|
want_evas_engine_direct3d="yes"
|
||||||
want_evas_image_loader_edb="no"
|
want_evas_image_loader_edb="no"
|
||||||
want_evas_image_loader_svg="no"
|
want_evas_image_loader_svg="yes"
|
||||||
;;
|
;;
|
||||||
darwin*)
|
darwin*)
|
||||||
want_evas_engine_software_xlib="auto"
|
want_evas_engine_software_xlib="auto"
|
||||||
|
|
|
@ -233,8 +233,8 @@ evas_image_loader_[]$1[]_cflags=""
|
||||||
evas_image_loader_[]$1[]_libs=""
|
evas_image_loader_[]$1[]_libs=""
|
||||||
|
|
||||||
PKG_CHECK_MODULES([SVG],
|
PKG_CHECK_MODULES([SVG],
|
||||||
[esvg >= 0.0.16],
|
[esvg >= 0.0.16 ender >= 0.0.6],
|
||||||
[have_dep="yes" have_esvg="yes" requirement="esvg"],
|
[have_dep="yes" have_esvg="yes" requirement="esvg >= 0.0.16 ender >= 0.0.6"],
|
||||||
[have_dep="no"])
|
[have_dep="no"])
|
||||||
|
|
||||||
if test "x${have_dep}" = "xyes" ; then
|
if test "x${have_dep}" = "xyes" ; then
|
||||||
|
|
|
@ -9,7 +9,8 @@ AM_CPPFLAGS = \
|
||||||
@PIXMAN_CFLAGS@ \
|
@PIXMAN_CFLAGS@ \
|
||||||
@EVAS_GENERAL_CFLAGS@ \
|
@EVAS_GENERAL_CFLAGS@ \
|
||||||
@FRIBIDI_CFLAGS@ \
|
@FRIBIDI_CFLAGS@ \
|
||||||
@evas_image_loader_svg_cflags@
|
@evas_image_loader_svg_cflags@ \
|
||||||
|
@EVIL_CFLAGS@
|
||||||
|
|
||||||
if BUILD_LOADER_SVG
|
if BUILD_LOADER_SVG
|
||||||
if !EVAS_STATIC_BUILD_SVG
|
if !EVAS_STATIC_BUILD_SVG
|
||||||
|
@ -19,7 +20,7 @@ pkg_LTLIBRARIES = module.la
|
||||||
|
|
||||||
module_la_SOURCES = evas_image_load_esvg.c
|
module_la_SOURCES = evas_image_load_esvg.c
|
||||||
|
|
||||||
module_la_LIBADD = @EVAS_GENERAL_LIBS@ @evas_image_loader_svg_libs@ $(top_builddir)/src/lib/libevas.la
|
module_la_LIBADD = @EVAS_GENERAL_LIBS@ @evas_image_loader_svg_libs@ @EVIL_LIBS@ $(top_builddir)/src/lib/libevas.la
|
||||||
module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
|
module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
|
||||||
module_la_LIBTOOLFLAGS = --tag=disable-static
|
module_la_LIBTOOLFLAGS = --tag=disable-static
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,18 @@
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_EVIL
|
||||||
|
# include <Evil.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <Esvg.h>
|
||||||
|
|
||||||
#include "evas_common.h"
|
#include "evas_common.h"
|
||||||
#include "evas_private.h"
|
#include "evas_private.h"
|
||||||
|
|
||||||
#include <Esvg.h>
|
|
||||||
|
|
||||||
static inline Eina_Bool evas_image_load_file_is_svg(const char *file) EINA_ARG_NONNULL(1) EINA_PURE;
|
static inline Eina_Bool evas_image_load_file_is_svg(const char *file) EINA_ARG_NONNULL(1) EINA_PURE;
|
||||||
static Eina_Bool evas_image_load_file_head_svg(Image_Entry *ie, const char *file, const char *key, int *error) EINA_ARG_NONNULL(1, 2, 4);
|
static Eina_Bool evas_image_load_file_head_svg(Image_Entry *ie, const char *file, const char *key, int *error) EINA_ARG_NONNULL(1, 2, 4);
|
||||||
static Eina_Bool evas_image_load_file_data_svg(Image_Entry *ie, const char *file, const char *key, int *error) EINA_ARG_NONNULL(1, 2, 4);
|
static Eina_Bool evas_image_load_file_data_svg(Image_Entry *ie, const char *file, const char *key, int *error) EINA_ARG_NONNULL(1, 2, 4);
|
||||||
|
@ -79,17 +87,16 @@ evas_image_load_file_head_svg(Image_Entry *ie, const char *file, const char *key
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
esvg_renderable_x_dpi_set(e, 75.0);
|
esvg_renderable_x_dpi_set(e, 92.0);
|
||||||
esvg_renderable_y_dpi_set(e, 75.0);
|
esvg_renderable_y_dpi_set(e, 92.0);
|
||||||
esvg_svg_actual_width_get(e, &sw);
|
esvg_svg_actual_width_get(e, &sw);
|
||||||
esvg_svg_actual_height_get(e, &sh);
|
esvg_svg_actual_height_get(e, &sh);
|
||||||
esvg_element_setup(e, NULL);
|
|
||||||
w = (int)ceil(sw);
|
w = (int)ceil(sw);
|
||||||
h = (int)ceil(sh);
|
h = (int)ceil(sh);
|
||||||
if ((w < 1) || (h < 1) || (w > IMG_MAX_SIZE) || (h > IMG_MAX_SIZE) ||
|
if ((w < 1) || (h < 1) || (w > IMG_MAX_SIZE) || (h > IMG_MAX_SIZE) ||
|
||||||
IMG_TOO_BIG(w, h))
|
IMG_TOO_BIG(w, h))
|
||||||
{
|
{
|
||||||
ender_element_delete(e);
|
ender_element_unref(e);
|
||||||
if (IMG_TOO_BIG(w, h))
|
if (IMG_TOO_BIG(w, h))
|
||||||
*error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
*error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
||||||
else
|
else
|
||||||
|
@ -127,7 +134,7 @@ evas_image_load_file_head_svg(Image_Entry *ie, const char *file, const char *key
|
||||||
ie->h = h;
|
ie->h = h;
|
||||||
ie->flags.alpha = 1;
|
ie->flags.alpha = 1;
|
||||||
|
|
||||||
ender_element_delete(e);
|
ender_element_unref(e);
|
||||||
|
|
||||||
*error = EVAS_LOAD_ERROR_NONE;
|
*error = EVAS_LOAD_ERROR_NONE;
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
@ -167,7 +174,7 @@ evas_image_load_file_data_svg(Image_Entry *ie, const char *file, const char *key
|
||||||
h = (int)ceil(sh);
|
h = (int)ceil(sh);
|
||||||
if ((w < 1) || (h < 1) || (w > IMG_MAX_SIZE) || (h > IMG_MAX_SIZE))
|
if ((w < 1) || (h < 1) || (w > IMG_MAX_SIZE) || (h > IMG_MAX_SIZE))
|
||||||
{
|
{
|
||||||
ender_element_delete(e);
|
ender_element_unref(e);
|
||||||
if (IMG_TOO_BIG(w, h))
|
if (IMG_TOO_BIG(w, h))
|
||||||
*error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
*error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
||||||
else
|
else
|
||||||
|
@ -251,7 +258,7 @@ evas_image_load_file_data_svg(Image_Entry *ie, const char *file, const char *key
|
||||||
memcpy (pixels, data, h * stride);
|
memcpy (pixels, data, h * stride);
|
||||||
|
|
||||||
enesim_surface_unref(s);
|
enesim_surface_unref(s);
|
||||||
ender_element_delete(e);
|
ender_element_unref(e);
|
||||||
|
|
||||||
evas_common_image_set_alpha_sparse(ie);
|
evas_common_image_set_alpha_sparse(ie);
|
||||||
|
|
||||||
|
@ -260,7 +267,7 @@ evas_image_load_file_data_svg(Image_Entry *ie, const char *file, const char *key
|
||||||
unref_surface:
|
unref_surface:
|
||||||
enesim_surface_unref(s);
|
enesim_surface_unref(s);
|
||||||
unref_renderer:
|
unref_renderer:
|
||||||
ender_element_delete(e);
|
ender_element_unref(e);
|
||||||
|
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue