diff options
author | Thiago Santos <thiagoss@embedded.ufcg.edu.br> | 2009-10-20 10:57:28 -0300 |
---|---|---|
committer | Thiago Santos <thiago.sousa.santos@collabora.co.uk> | 2009-10-26 09:04:49 -0300 |
commit | 106971243824bd756995f391e9ba2829ae31516a (patch) | |
tree | 220269722e9b208eddb1b29c82a08e7146990c6b | |
parent | 8db28217911eacdb892b3176b5bb257f6bc7f9a9 (diff) |
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]
-rw-r--r-- | gst/mpegvideoparse/mpegvideoparse.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gst/mpegvideoparse/mpegvideoparse.c b/gst/mpegvideoparse/mpegvideoparse.c index f175cfa83..7328fc70f 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; |