diff --git a/ext/rsvg/gstrsvgdec.c b/ext/rsvg/gstrsvgdec.c index a7d42e89f7..624c9e9f6b 100644 --- a/ext/rsvg/gstrsvgdec.c +++ b/ext/rsvg/gstrsvgdec.c @@ -180,11 +180,11 @@ gst_rsvg_decode_image (GstRsvgDec * rsvg, GstBuffer * buffer, || GST_VIDEO_INFO_HEIGHT (&output_state->info) != dimension.height) { /* Create the output state */ - gst_video_decoder_set_output_state (decoder, GST_RSVG_VIDEO_FORMAT, - dimension.width, dimension.height, rsvg->input_state); if (output_state) gst_video_codec_state_unref (output_state); - output_state = gst_video_decoder_get_output_state (decoder); + output_state = + gst_video_decoder_set_output_state (decoder, GST_RSVG_VIDEO_FORMAT, + dimension.width, dimension.height, rsvg->input_state); } ret = gst_video_decoder_allocate_output_frame (decoder, frame); @@ -261,9 +261,10 @@ gst_rsvg_dec_set_format (GstVideoDecoder * decoder, GstVideoCodecState * state) rsvg->input_state = gst_video_codec_state_ref (state); /* Create the output state */ - gst_video_decoder_set_output_state (decoder, GST_RSVG_VIDEO_FORMAT, + state = gst_video_decoder_set_output_state (decoder, GST_RSVG_VIDEO_FORMAT, GST_VIDEO_INFO_WIDTH (info), GST_VIDEO_INFO_HEIGHT (info), rsvg->input_state); + gst_video_codec_state_unref (state); return TRUE; }