summaryrefslogtreecommitdiff
path: root/libavformat/concat.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-22 08:31:50 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-27 04:27:09 +0100
commit19ae873252c35a78b9bc1918f2878f47a1f4dc2d (patch)
treec6c50c9ac0d424eae67bce4c3e0cb349450d0dae /libavformat/concat.c
parent8e94b7cff03539bcb4c360d2550a031a5378df03 (diff)
avformat/wavenc: Fix leak and segfault on reallocation error
Up until now, the wav muxer used a reallocation of the form ptr = av_realloc(ptr, size); that leaks upon error. Furthermore, if a failed reallocation happened when writing the trailer, a segfault would occur due to avio_write(NULL, size) because the muxer only prints an error message upon allocation error, but does not return the error. Moreover setting the pointer to the buffer to NULL on error seems to be done on purpose in order to record that an error has occured so that outputting the peak values is no longer attempted. This behaviour has been retained by simply disabling whether peak data should be written if an error occurs. Finally, the reallocation is now done once per peak block and not once per peak block per channel; it is also done with av_fast_realloc and not with a linear size increase. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat/concat.c')
0 files changed, 0 insertions, 0 deletions