From 106971243824bd756995f391e9ba2829ae31516a Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Tue, 20 Oct 2009 10:57:28 -0300 Subject: [PATCH] mpegvideoparse: check width/height range Checks if the width/height that are to be set on src pad caps are within valid range of [16,4096] --- gst/mpegvideoparse/mpegvideoparse.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gst/mpegvideoparse/mpegvideoparse.c b/gst/mpegvideoparse/mpegvideoparse.c index f175cfa83c..7328fc70f6 100644 --- a/gst/mpegvideoparse/mpegvideoparse.c +++ b/gst/mpegvideoparse/mpegvideoparse.c @@ -243,6 +243,13 @@ mpegvideoparse_handle_sequence (MpegVideoParse * mpegvideoparse, if (G_UNLIKELY (!mpeg_util_parse_sequence_hdr (&new_hdr, cur, end))) return FALSE; + if (new_hdr.width < 16 || new_hdr.width > 4096 || + new_hdr.height < 16 || new_hdr.height > 4096) { + GST_WARNING_OBJECT (mpegvideoparse, "Width/height out of valid range " + "[16, 4096]"); + return FALSE; + } + if (memcmp (&mpegvideoparse->seq_hdr, &new_hdr, sizeof (MPEGSeqHdr)) != 0) { GstCaps *caps; GstBuffer *seq_buf;