analytics: Add validation on classification analytics-meta

- Add valiation on parameters passed to gst_analytics_cls_add_cls_mtd.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7046>
This commit is contained in:
Daniel Morin 2024-06-17 15:38:05 -04:00 committed by GStreamer Marge Bot
parent 9da1268656
commit 55b12a80d6

View file

@ -197,6 +197,9 @@ gst_analytics_relation_meta_add_cls_mtd (GstAnalyticsRelationMeta *
GstAnalyticsClsMtd * cls_mtd)
{
g_return_val_if_fail (instance, FALSE);
g_return_val_if_fail (confidence_levels != NULL, FALSE);
g_return_val_if_fail (class_quarks != NULL, FALSE);
gsize confidence_levels_size =
(sizeof (GstAnalyticsClsConfLvlAndClass) * length);
gsize size = sizeof (GstAnalyticsClsMtdData) + confidence_levels_size;