diff --git a/ChangeLog b/ChangeLog index a81f799dd1..b6a7fda79a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-04-20 Sebastian Dröge + + * ext/ogg/gstogmparse.c: (gst_ogm_parse_stream_header): + GST_TYPE_FRACTION contains gints so correctly cast gint64 arguments to + vaargs functions to gint. Otherwise the fractions will get 0 set + instead of the correct value on big endian systems. Fixes bug #529018. + 2008-04-20 Sebastian Dröge * ext/gnomevfs/gstgnomevfssink.c: diff --git a/ext/ogg/gstogmparse.c b/ext/ogg/gstogmparse.c index cdf3c75296..b52b466532 100644 --- a/ext/ogg/gstogmparse.c +++ b/ext/ogg/gstogmparse.c @@ -577,6 +577,7 @@ gst_ogm_parse_stream_header (GstOgmParse * ogm, const guint8 * data, guint size) } case 'v':{ guint32 fourcc; + gint time_unit; fourcc = GST_MAKE_FOURCC (ogm->hdr.subtype[0], ogm->hdr.subtype[1], ogm->hdr.subtype[2], ogm->hdr.subtype[3]); @@ -601,10 +602,15 @@ gst_ogm_parse_stream_header (GstOgmParse * ogm, const guint8 * data, guint size) ogm->hdr.samples_per_unit, ogm->hdr.default_len, 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) + GST_WARNING_OBJECT (ogm, "timeunit is out of range"); + + time_unit = (gint) CLAMP (ogm->hdr.time_unit, G_MININT, 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, - "framerate", GST_TYPE_FRACTION, 10000000, ogm->hdr.time_unit, NULL); + "framerate", GST_TYPE_FRACTION, 10000000, time_unit, NULL); break; } case 't':{