videotestsrc: bail out on unsupported caps
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 10 Apr 2014 14:51:05 +0000 (15:51 +0100)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 10 Apr 2014 14:51:05 +0000 (15:51 +0100)
This avoids using uninitialized data (and properly rejects caps).

Coverity 1139898

gst/videotestsrc/gstvideotestsrc.c

index b3dacbe..6951b3d 100644 (file)
@@ -708,6 +708,8 @@ gst_video_test_src_setcaps (GstBaseSrc * bsrc, GstCaps * caps)
     videotestsrc->bayer = TRUE;
     videotestsrc->x_invert = x_inv;
     videotestsrc->y_invert = y_inv;
+  } else {
+    goto unsupported_caps;
   }
 
   /* create chroma subsampler */
@@ -764,6 +766,11 @@ parse_failed:
     GST_DEBUG_OBJECT (bsrc, "failed to parse caps");
     return FALSE;
   }
+unsupported_caps:
+  {
+    GST_DEBUG_OBJECT (bsrc, "unsupported caps: %" GST_PTR_FORMAT, caps);
+    return FALSE;
+  }
 }
 
 static gboolean