From 437be0af75ad3a3310c546fc98bda50c7223ed81 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 23 Sep 2024 09:35:00 +0200 Subject: [PATCH] json-pod: return errors from spa_json_next() Instead of silently ignoring the error and continuing. See #4313 --- spa/include/spa/utils/json-pod.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spa/include/spa/utils/json-pod.h b/spa/include/spa/utils/json-pod.h index 2a0813fd8..579ae7a7a 100644 --- a/spa/include/spa/utils/json-pod.h +++ b/spa/include/spa/utils/json-pod.h @@ -52,6 +52,8 @@ static inline int spa_json_to_pod_part(struct spa_pod_builder *b, uint32_t flags if ((res = spa_json_to_pod_part(b, flags, id, pi, &it[0], v, l)) < 0) return res; } + if (l < 0) + return l; spa_pod_builder_pop(b, &f[0]); } else if (spa_json_is_array(value, len)) { @@ -65,6 +67,8 @@ static inline int spa_json_to_pod_part(struct spa_pod_builder *b, uint32_t flags while ((l = spa_json_next(&it[0], &v)) > 0) if ((res = spa_json_to_pod_part(b, flags, id, info, &it[0], v, l)) < 0) return res; + if (l < 0) + return l; spa_pod_builder_pop(b, &f[0]); } else if (spa_json_is_float(value, len)) {