aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/extract_mvs.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-10-17 12:32:54 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-27 07:20:58 +0100
commit59b8634411ba2a6c7700968b3af5b400b14f0f41 (patch)
tree826075fc66b0913694f00544ff76c853f40468ba /doc/examples/extract_mvs.c
parent2e49daad795832b23325e9294f9444928a5b5cb3 (diff)
downloadffmpeg-59b8634411ba2a6c7700968b3af5b400b14f0f41.tar.gz
avcodec/movtextdec: Fix leaks of strings upon reallocation failure
Up until now, the 3GPP Timed Text decoder used av_dynarray_add() for a list of font entries, a structure which contains an allocated string. The font entries are owned by the pointers in the dynamic array and are therefore unsuitable for av_dynarray_add() which simply frees the array, but not the font entries and of course not the strings. The latter all leak if reallocating the dynamic array fails. This commit fixes this. It stops reallocating the array altogether: After all, the final number of elements (pending errors) is already known in advance. Furthermore, the font entries are now the entries of the new array, i.e. the font entries are no longer allocated separately. This also removes one level of indirection. Reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> (cherry picked from commit 38cdd27e9b36183a74c19859a8092aca6e82d712)
Diffstat (limited to 'doc/examples/extract_mvs.c')
0 files changed, 0 insertions, 0 deletions