diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-08-07 06:09:59 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-08-23 22:05:40 +0200 |
commit | 6a65449954d466e76c1166f524d2f6cde28c3c96 (patch) | |
tree | d2717aeefdf32cfb027c8dc3c1a21b911f4bd807 /libavcodec/libavcodec.v | |
parent | deb6476fd8bc3a3c2b134704ecb804269843ed89 (diff) | |
download | ffmpeg-6a65449954d466e76c1166f524d2f6cde28c3c96.tar.gz |
avfilter/vf_paletteuse: Fix leaks of AVFilterFormats on error
The paletteuse's query_formats function allocated three AVFilterFormats
before storing them permanently. If allocating one of them failed, the
three AVFilterFormats structures would be freed with av_freep() which
does not free separately allocated subelements (namely the formats
array) which leak.
Furthermore, if storing one of the first two fails, the function simply
returns and the ones not yet stored leak.
These leaks have been fixed by only creating a new AVFilterFormats after
the last one has already been permanently stored. Furthermore, it is
enough to check whether the elements have been properly stored as
ff_formats_ref() by design returns AVERROR(ENOMEM) if it is provided a
NULL AVFilterFormats *.
Fixes Coverity issues #1270818 and #1270819.
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/libavcodec.v')
0 files changed, 0 insertions, 0 deletions