From: Edward Hervey Date: Wed, 1 Nov 2017 10:19:58 +0000 (+0100) Subject: ogmparse: Ensure we don't create bogus fractions X-Git-Tag: 1.19.3~511^2~2076 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f1c44332d5a07d837af9123736148644c9df45d0;p=platform%2Fupstream%2Fgstreamer.git ogmparse: Ensure we don't create bogus fractions The clamping of the fraction denominator was bogus (it needs to be >0) --- diff --git a/ext/ogg/gstogmparse.c b/ext/ogg/gstogmparse.c index fc00538..256112b 100644 --- a/ext/ogg/gstogmparse.c +++ b/ext/ogg/gstogmparse.c @@ -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); /* 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"); - 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, "width", G_TYPE_INT, ogm->hdr.s.video.width, "height", G_TYPE_INT, ogm->hdr.s.video.height,