From e5a0c4a751383145d6a5da4e1912d21f41c5e575 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Mon, 5 Jun 2017 15:31:52 +0100 Subject: [PATCH] jpeg2000sampling: fix critical when sampling is missing from caps This can happen with real files --- gst-libs/gst/codecparsers/gstjpeg2000sampling.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/codecparsers/gstjpeg2000sampling.c b/gst-libs/gst/codecparsers/gstjpeg2000sampling.c index ab8321f209..543282d495 100644 --- a/gst-libs/gst/codecparsers/gstjpeg2000sampling.c +++ b/gst-libs/gst/codecparsers/gstjpeg2000sampling.c @@ -46,7 +46,8 @@ GstJPEG2000Sampling gst_jpeg2000_sampling_from_string (const gchar * sampling_string) { GstJPEG2000Sampling i; - g_return_val_if_fail (sampling_string != NULL, GST_JPEG2000_SAMPLING_NONE); + if (sampling_string == NULL) + return GST_JPEG2000_SAMPLING_NONE; for (i = 0; i < G_N_ELEMENTS (gst_jpeg2000_sampling_strings); ++i) { if (!g_strcmp0 (sampling_string, gst_jpeg2000_sampling_strings[i])) return (i + 1);