summaryrefslogtreecommitdiff
path: root/libavfilter/formats.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-11-17 00:22:20 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-11-21 12:27:07 +0000
commit863ee8a855b8ce27ffef41479eb66da58763faed (patch)
tree567301d72492ac0082b96bc628d9d6e8f7cc7378 /libavfilter/formats.c
parentfd9badd3cb3b60f5c54dcea35523e1ecca2f67a6 (diff)
lavfi: clean memory on error in ADD_FORMAT()
CC: libav-stable@libav.org Bug-Id: CID 1250334
Diffstat (limited to 'libavfilter/formats.c')
-rw-r--r--libavfilter/formats.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavfilter/formats.c b/libavfilter/formats.c
index 24a4fab0d1..ea61ed2da6 100644
--- a/libavfilter/formats.c
+++ b/libavfilter/formats.c
@@ -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; \