diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-12-03 13:12:39 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-12-05 13:27:37 +0100 |
commit | 3ca1e31e63085ab84bc2d031c9ba06ea161188d3 (patch) | |
tree | 98075d431dea6617d68248d17675eb84990fae02 /fftools/ffmpeg_hw.c | |
parent | 3a9861e22c636d843c10e23f5585196d1f3400dd (diff) | |
download | ffmpeg-3ca1e31e63085ab84bc2d031c9ba06ea161188d3.tar.gz |
fftools/cmdutils: Atomically add elements to list of pointers, fix crash
Currently, adding a (separately allocated) element to a list of pointers
works by first reallocating the array of pointers and (on success)
incrementing its size and only then allocating the new element.
If the latter allocation fails, the size is inconsistent, i.e.
array[nb_array_elems - 1] is NULL. Our cleanup code crashes in such
scenarios.
Fix this by adding an auxiliary function that atomically allocates
and adds a new element to a list of pointers.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'fftools/ffmpeg_hw.c')
0 files changed, 0 insertions, 0 deletions