fftools/cmdutils: add error handling to allocate_array_elem()

This commit is contained in:
Anton Khirnov
2023-07-13 17:50:16 +02:00
parent 8eb5adeab8
commit 6be4a29397
5 changed files with 51 additions and 14 deletions

View File

@@ -1002,7 +1002,7 @@ void *allocate_array_elem(void *ptr, size_t elem_size, int *nb_elems)
if (!(new_elem = av_mallocz(elem_size)) ||
av_dynarray_add_nofree(ptr, nb_elems, new_elem) < 0)
report_and_exit(AVERROR(ENOMEM));
return NULL;
return new_elem;
}