mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
ogmparse: Ensure we don't create bogus fractions
The clamping of the fraction denominator was bogus (it needs to be >0)
This commit is contained in:
parent
eb8bf0f162
commit
f1c44332d5
1 changed files with 2 additions and 2 deletions
|
@ -590,10 +590,10 @@ gst_ogm_parse_stream_header (GstOgmParse * ogm, const guint8 * data, guint size)
|
||||||
ogm->hdr.buffersize, ogm->hdr.bits_per_sample, caps);
|
ogm->hdr.buffersize, ogm->hdr.bits_per_sample, caps);
|
||||||
|
|
||||||
/* GST_TYPE_FRACTION contains gint */
|
/* GST_TYPE_FRACTION contains gint */
|
||||||
if (ogm->hdr.time_unit > G_MAXINT || ogm->hdr.time_unit < G_MININT)
|
if (ogm->hdr.time_unit > G_MAXINT || ogm->hdr.time_unit < 1)
|
||||||
GST_WARNING_OBJECT (ogm, "timeunit is out of range");
|
GST_WARNING_OBJECT (ogm, "timeunit is out of range");
|
||||||
|
|
||||||
time_unit = (gint) CLAMP (ogm->hdr.time_unit, G_MININT, G_MAXINT);
|
time_unit = (gint) CLAMP (ogm->hdr.time_unit, 1, G_MAXINT);
|
||||||
gst_caps_set_simple (caps,
|
gst_caps_set_simple (caps,
|
||||||
"width", G_TYPE_INT, ogm->hdr.s.video.width,
|
"width", G_TYPE_INT, ogm->hdr.s.video.width,
|
||||||
"height", G_TYPE_INT, ogm->hdr.s.video.height,
|
"height", G_TYPE_INT, ogm->hdr.s.video.height,
|
||||||
|
|
Loading…
Reference in a new issue