ext/mpeg2dec/gstmpeg2dec.c: Don't allow width/height outside the spec (i.e. smaller than 16 and higher than 4096). Su...

Original commit message from CVS:
* ext/mpeg2dec/gstmpeg2dec.c: (handle_sequence):
Don't allow width/height outside the spec (i.e. smaller than 16
and higher than 4096). Such files are corrupted ones and setting
caps that are not a subset of the template caps confuses playbin.
Fixes bug #542646.
This commit is contained in:
Sebastian Dröge 2008-07-13 10:13:06 +00:00
parent 5352800cc1
commit 171116f99a
3 changed files with 18 additions and 1 deletions

View file

@ -1,3 +1,11 @@
2008-07-13 Sebastian Dröge <sebastian.droege@collabora.co.uk>
* ext/mpeg2dec/gstmpeg2dec.c: (handle_sequence):
Don't allow width/height outside the spec (i.e. smaller than 16
and higher than 4096). Such files are corrupted ones and setting
caps that are not a subset of the template caps confuses playbin.
Fixes bug #542646.
2008-07-11 Sebastian Dröge <sebastian.droege@collabora.co.uk>
* ext/sidplay/Makefile.am:

2
common

@ -1 +1 @@
Subproject commit 79ade7b9c9bf47eee491ceee4cf3ea116140ad35
Subproject commit a100efef186a5f8999fe3aa42c0720f5123c08eb

View file

@ -626,6 +626,15 @@ handle_sequence (GstMpeg2dec * mpeg2dec, const mpeg2_info_t * info)
mpeg2dec->decoded_height = info->sequence->height;
mpeg2dec->total_frames = 0;
/* mpeg2 video can only be from 16x16 to 4096x4096. Everything
* else is a corrupted files */
if (mpeg2dec->width > 4096 || mpeg2dec->width < 16 ||
mpeg2dec->height > 4096 || mpeg2dec->height < 16) {
GST_ERROR_OBJECT (mpeg2dec, "Invalid frame dimensions: %d x %d",
mpeg2dec->width, mpeg2dec->height);
return GST_FLOW_ERROR;
}
/* set framerate */
mpeg2dec->fps_n = 27000000;
mpeg2dec->fps_d = info->sequence->frame_period;