From 44d22d3e820616689d4bf2575a93cec2186724ee Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Fri, 27 Apr 2012 09:05:57 -0300 Subject: [PATCH] vp8dec: Use outputstate when copying output buffer data Using the input state was causing a crash because the strides/offsets would be wrong. Fix it by using the output as we are dealing with the decoded frame. --- ext/vp8/gstvp8dec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ext/vp8/gstvp8dec.c b/ext/vp8/gstvp8dec.c index 71683c1781..724e6e15e3 100644 --- a/ext/vp8/gstvp8dec.c +++ b/ext/vp8/gstvp8dec.c @@ -326,7 +326,11 @@ gst_vp8_dec_image_to_buffer (GstVP8Dec * dec, const vpx_image_t * img, { int stride, w, h, i; guint8 *d; - GstVideoInfo *info = &dec->input_state->info; + GstVideoCodecState *outputstate; + GstVideoInfo *info; + + outputstate = gst_video_decoder_get_output_state (GST_VIDEO_DECODER (dec)); + info = &outputstate->info; d = GST_BUFFER_DATA (buffer) + GST_VIDEO_INFO_COMP_OFFSET (info, 0); stride = GST_VIDEO_INFO_COMP_STRIDE (info, 0); @@ -354,6 +358,8 @@ gst_vp8_dec_image_to_buffer (GstVP8Dec * dec, const vpx_image_t * img, for (i = 0; i < h; i++) memcpy (d + i * stride, img->planes[VPX_PLANE_V] + i * img->stride[VPX_PLANE_V], w); + + gst_video_codec_state_unref (outputstate); } static GstFlowReturn