From: David Schleef Date: Wed, 14 May 2003 18:43:36 +0000 (+0000) Subject: Fix issues with invalid fourcc parameters. X-Git-Tag: 1.19.3~511^2~15414 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=90e3d8cd2e4121a6aeaea9809e930606adca9ad2;p=platform%2Fupstream%2Fgstreamer.git Fix issues with invalid fourcc parameters. Original commit message from CVS: Fix issues with invalid fourcc parameters. --- diff --git a/gst/videotestsrc/gstvideotestsrc.c b/gst/videotestsrc/gstvideotestsrc.c index e3dcb5e2f6..637d984dae 100644 --- a/gst/videotestsrc/gstvideotestsrc.c +++ b/gst/videotestsrc/gstvideotestsrc.c @@ -255,11 +255,18 @@ gst_videotestsrc_getcaps (GstPad * pad, GstCaps * caps) vts = GST_VIDEOTESTSRC (gst_pad_get_parent (pad)); + caps1 = NULL; + if (vts->forced_format != NULL) { struct fourcc_list_struct *fourcc; + fourcc = paintrect_find_name (vts->forced_format); - caps1 = paint_get_caps(fourcc); - } else { + if (fourcc) { + caps1 = paint_get_caps(fourcc); + } + } + + if (caps1 == NULL) { caps1 = gst_videotestsrc_get_capslist (); } diff --git a/gst/videotestsrc/videotestsrc.c b/gst/videotestsrc/videotestsrc.c index b63cab8650..56139f24e6 100644 --- a/gst/videotestsrc/videotestsrc.c +++ b/gst/videotestsrc/videotestsrc.c @@ -435,6 +435,8 @@ GstCaps *paint_get_caps(struct fourcc_list_struct *format) unsigned int fourcc; GstCaps *caps; + g_return_val_if_fail(format, NULL); + fourcc = GST_MAKE_FOURCC (format->fourcc[0], format->fourcc[1], format->fourcc[2], format->fourcc[3]); if(format->ext_caps){