rsvgdec: Unref handle and output state on error paths

CID 1214604
This commit is contained in:
Sebastian Dröge 2014-05-19 09:12:14 +02:00
parent c842df1c3d
commit cbc37f389f

View file

@ -191,6 +191,7 @@ gst_rsvg_decode_image (GstRsvgDec * rsvg, GstBuffer * buffer,
if (ret != GST_FLOW_OK) {
g_object_unref (handle);
gst_video_codec_state_unref (output_state);
GST_ERROR_OBJECT (rsvg, "Buffer allocation failed %s",
gst_flow_get_name (ret));
return ret;
@ -205,6 +206,8 @@ gst_rsvg_decode_image (GstRsvgDec * rsvg, GstBuffer * buffer,
&gst_video_decoder_get_output_state (decoder)->info,
frame->output_buffer, GST_MAP_READWRITE)) {
GST_ERROR_OBJECT (rsvg, "Failed to get SVG image");
g_object_unref (handle);
gst_video_codec_state_unref (output_state);
return GST_FLOW_ERROR;
}
surface =