From 90e3d8cd2e4121a6aeaea9809e930606adca9ad2 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Wed, 14 May 2003 18:43:36 +0000 Subject: [PATCH] Fix issues with invalid fourcc parameters. Original commit message from CVS: Fix issues with invalid fourcc parameters. --- gst/videotestsrc/gstvideotestsrc.c | 11 +++++++++-- gst/videotestsrc/videotestsrc.c | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) 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){ -- 2.34.1