From ac7cba4ac2a846ccf2cf5465aa0f7e26660cd129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 14 May 2010 14:02:53 +0200 Subject: [PATCH] vp8dec: Correctly initialize stream info before peeking at the stream Otherwise peeking will fail and we'll get invalid values --- ext/vp8/gstvp8dec.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ext/vp8/gstvp8dec.c b/ext/vp8/gstvp8dec.c index 06fa638560..077e81b1c8 100644 --- a/ext/vp8/gstvp8dec.c +++ b/ext/vp8/gstvp8dec.c @@ -276,7 +276,7 @@ gst_vp8_dec_handle_frame (GstBaseVideoDecoder * decoder, GstVideoFrame * frame) long status; vpx_codec_iter_t iter = NULL; vpx_image_t *img; - + vpx_codec_err_t res; GST_DEBUG ("handle_frame"); @@ -285,11 +285,14 @@ gst_vp8_dec_handle_frame (GstBaseVideoDecoder * decoder, GstVideoFrame * frame) if (!dec->decoder_inited) { vpx_codec_stream_info_t stream_info; - vpx_codec_peek_stream_info (&vpx_codec_vp8_dx_algo, + memset (&stream_info, 0, sizeof (stream_info)); + stream_info.sz = sizeof (stream_info); + + res = vpx_codec_peek_stream_info (&vpx_codec_vp8_dx_algo, GST_BUFFER_DATA (frame->sink_buffer), GST_BUFFER_SIZE (frame->sink_buffer), &stream_info); - if (!stream_info.is_kf) { + if (res != VPX_CODEC_OK || !stream_info.is_kf) { gst_base_video_decoder_skip_frame (decoder, frame); return GST_FLOW_OK; }