mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 05:31:15 +00:00
rsvgoverlay: Do not segfault on unexistent files
When passing an unexistent file to rsvgoverlay it would crash because the svg loading would fail without setting an error. This patch makes it check if the handle was actually created and logs an error in case it didn't. Maybe it should post an error to the bus, but the previous error handling didn't, so I just followed the same logic.
This commit is contained in:
parent
97789fa5bc
commit
a875342c54
1 changed files with 8 additions and 4 deletions
|
@ -126,10 +126,14 @@ gst_rsvg_overlay_set_svg_data (GstRsvgOverlay * overlay, const gchar * data,
|
||||||
else
|
else
|
||||||
overlay->handle =
|
overlay->handle =
|
||||||
rsvg_handle_new_from_data ((guint8 *) data, size, &error);
|
rsvg_handle_new_from_data ((guint8 *) data, size, &error);
|
||||||
|
if (error || overlay->handle == NULL) {
|
||||||
if (error) {
|
if (error) {
|
||||||
GST_ERROR_OBJECT (overlay, "Cannot read SVG data: %s\n%s",
|
GST_ERROR_OBJECT (overlay, "Cannot read SVG data: %s\n%s",
|
||||||
error->message, data);
|
error->message, data);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
} else {
|
||||||
|
GST_ERROR_OBJECT (overlay, "Cannot read SVG data: %s", data);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Get SVG dimension. */
|
/* Get SVG dimension. */
|
||||||
RsvgDimensionData svg_dimension;
|
RsvgDimensionData svg_dimension;
|
||||||
|
|
Loading…
Reference in a new issue