mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 08:41:07 +00:00
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.
This commit is contained in:
parent
7fee866764
commit
44d22d3e82
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue