JSON format: fix some memleaks

This commit is contained in:
李通洲
2023-09-08 20:03:26 +08:00
parent d97b16950c
commit 1cdc99f327
4 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -199,6 +199,7 @@ void ffGenerateDisplayJson(FF_MAYBE_UNUSED FFDisplayOptions* options, yyjson_mut
FF_LIST_FOR_EACH(FFDisplayResult, item, dsResult->displays)
{
yyjson_mut_val* obj = yyjson_mut_arr_add_obj(doc, arr);
yyjson_mut_obj_add_uint(doc, obj, "width", item->width);
yyjson_mut_obj_add_uint(doc, obj, "height", item->height);
yyjson_mut_obj_add_uint(doc, obj, "id", item->id);
yyjson_mut_obj_add_strbuf(doc, obj, "name", &item->name);
@@ -219,6 +220,5 @@ void ffGenerateDisplayJson(FF_MAYBE_UNUSED FFDisplayOptions* options, yyjson_mut
yyjson_mut_obj_add_str(doc, obj, "type", "Unknown");
break;
}
yyjson_mut_obj_add_uint(doc, obj, "scaledWidth", item->width);
}
}