videotestsrc: bail out on unsupported caps

This avoids using uninitialized data (and properly rejects caps).

Coverity 1139898
This commit is contained in:
Vincent Penquerc'h 2014-04-10 15:51:05 +01:00
parent 577ec29245
commit ba8220a9fd

View 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