diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-11-17 02:22:20 +0300 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-11-21 15:27:07 +0300 |
commit | 863ee8a855b8ce27ffef41479eb66da58763faed (patch) | |
tree | 567301d72492ac0082b96bc628d9d6e8f7cc7378 /libavfilter | |
parent | fd9badd3cb3b60f5c54dcea35523e1ecca2f67a6 (diff) |
lavfi: clean memory on error in ADD_FORMAT()
CC: libav-stable@libav.org
Bug-Id: CID 1250334
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/formats.c | 4 |
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; \ |