Commit 863ee8a8 authored by Vittorio Giovara's avatar Vittorio Giovara

lavfi: clean memory on error in ADD_FORMAT()

CC: libav-stable@libav.org
Bug-Id: CID 1250334
parent fd9badd3
......@@ -188,8 +188,10 @@ do { \
\
fmts = av_realloc((*f)->list, \
sizeof(*(*f)->list) * ((*f)->nb + 1));\
if (!fmts) \
if (!fmts) { \
av_freep(&f); \
return AVERROR(ENOMEM); \
} \
\
(*f)->list = fmts; \
(*f)->list[(*f)->nb++] = fmt; \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment