From be82ae207a30dd16a932adb508ba616170b5be49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 6 Mar 2012 14:50:06 +0100 Subject: [PATCH] vdpau: Fix loop to not read before the valid memory area --- sys/vdpau/h264/gstvdph264dec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/vdpau/h264/gstvdph264dec.c b/sys/vdpau/h264/gstvdph264dec.c index 6b6c3360a5..d7af47b6f4 100644 --- a/sys/vdpau/h264/gstvdph264dec.c +++ b/sys/vdpau/h264/gstvdph264dec.c @@ -716,7 +716,7 @@ gst_vdp_h264_dec_parse_data (GstBaseVideoDecoder * base_video_decoder, size = gst_bit_reader_get_remaining (&reader) / 8; i = size - 1; - while (size >= 0 && data[i] == 0x00) { + while (size > 0 && data[i] == 0x00) { size--; i--; } @@ -870,8 +870,7 @@ gst_vdp_h264_dec_base_init (gpointer g_class) "Decode h264 stream with vdpau", "Carl-Anton Ingmarsson "); - gst_element_class_add_static_pad_template (element_class, - &sink_template); + gst_element_class_add_static_pad_template (element_class, &sink_template); } static void