From: <wt...@ke...> - 2006-07-27 11:00:33
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: wtay Date: Thu Jul 27 2006 11:00:33 UTC Log message: * gst/gstcaps.c: (gst_static_caps_get), (gst_caps_get_structure): Fix useless assert, a uint is always positive. * gst/gststructure.c: (gst_structure_nth_field_name), (gst_structure_foreach), (gst_structure_map_in_place): Check input arguments for public functions to avoid obvious crashes. * plugins/elements/gstfakesink.c: (gst_fake_sink_render): * plugins/elements/gstfakesink.h: Do less useless typechecking. Modified files: . : ChangeLog gst : gstcaps.c gststructure.c plugins/elements: gstfakesink.c gstfakesink.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.2704&r2=1.2705 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstcaps.c.diff?r1=1.168&r2=1.169 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gststructure.c.diff?r1=1.77&r2=1.78 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/plugins/elements/gstfakesink.c.diff?r1=1.103&r2=1.104 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/plugins/elements/gstfakesink.h.diff?r1=1.31&r2=1.32 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.2704 retrieving revision 1.2705 diff -u -d -r1.2704 -r1.2705 --- ChangeLog 27 Jul 2006 10:54:29 -0000 1.2704 +++ ChangeLog 27 Jul 2006 11:00:20 -0000 1.2705 @@ -1,3 +1,16 @@ +2006-07-27 Wim Taymans <wi...@fl...> + + * gst/gstcaps.c: (gst_static_caps_get), (gst_caps_get_structure): + Fix useless assert, a uint is always positive. + * gst/gststructure.c: (gst_structure_nth_field_name), + (gst_structure_foreach), (gst_structure_map_in_place): + Check input arguments for public functions to avoid obvious crashes. + * plugins/elements/gstfakesink.c: (gst_fake_sink_render): + * plugins/elements/gstfakesink.h: + Do less useless typechecking. 2006-07-27 Tim-Philipp Müller <tim at centricular dot net> * plugins/elements/gstfilesrc.c: (gst_file_src_class_init): Index: gstcaps.c RCS file: /cvs/gstreamer/gstreamer/gst/gstcaps.c,v retrieving revision 1.168 retrieving revision 1.169 diff -u -d -r1.168 -r1.169 --- gstcaps.c 3 Jul 2006 16:57:54 -0000 1.168 +++ gstcaps.c 27 Jul 2006 11:00:20 -0000 1.169 @@ -604,7 +604,6 @@ gst_caps_get_structure (const GstCaps * caps, guint index) { g_return_val_if_fail (GST_IS_CAPS (caps), NULL); - g_return_val_if_fail (index >= 0, NULL); g_return_val_if_fail (index < caps->structs->len, NULL); return g_ptr_array_index (caps->structs, index); Index: gststructure.c RCS file: /cvs/gstreamer/gstreamer/gst/gststructure.c,v retrieving revision 1.77 retrieving revision 1.78 diff -u -d -r1.77 -r1.78 --- gststructure.c 26 Jul 2006 17:04:45 -0000 1.77 +++ gststructure.c 27 Jul 2006 11:00:20 -0000 1.78 @@ -834,7 +834,11 @@ GstStructureField *field; + g_return_val_if_fail (structure != NULL, NULL); + g_return_val_if_fail (index < structure->fields->len, NULL); field = GST_STRUCTURE_FIELD (structure, index); return g_quark_to_string (field->name); } @@ -859,6 +863,7 @@ gboolean ret; g_return_val_if_fail (structure != NULL, FALSE); + g_return_val_if_fail (func != NULL, FALSE); for (i = 0; i < structure->fields->len; i++) { field = GST_STRUCTURE_FIELD (structure, i); @@ -894,6 +899,7 @@ g_return_val_if_fail (IS_MUTABLE (structure), FALSE); Index: gstfakesink.c RCS file: /cvs/gstreamer/gstreamer/plugins/elements/gstfakesink.c,v retrieving revision 1.103 retrieving revision 1.104 diff -u -d -r1.103 -r1.104 --- gstfakesink.c 23 May 2006 14:23:49 -0000 1.103 +++ gstfakesink.c 27 Jul 2006 11:00:21 -0000 1.104 @@ -361,7 +361,7 @@ static GstFlowReturn gst_fake_sink_render (GstBaseSink * bsink, GstBuffer * buf) - GstFakeSink *sink = GST_FAKE_SINK (bsink); + GstFakeSink *sink = GST_FAKE_SINK_CAST (bsink); if (!sink->silent) { gchar ts_str[64], dur_str[64]; Index: gstfakesink.h RCS file: /cvs/gstreamer/gstreamer/plugins/elements/gstfakesink.h,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- gstfakesink.h 1 Jun 2006 18:22:14 -0000 1.31 +++ gstfakesink.h 27 Jul 2006 11:00:21 -0000 1.32 @@ -40,6 +40,7 @@ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FAKE_SINK)) #define GST_IS_FAKE_SINK_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKE_SINK)) +#define GST_FAKE_SINK_CAST(obj) ((GstFakeSink *)obj) /** * GstFakeSinkStateError: |