summaryrefslogtreecommitdiff
path: root/fftools
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-04-29 20:55:26 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-05-06 10:49:51 +0200
commit3a822717bd6b0dd88ad8676ed9133dd65f7dd56a (patch)
tree623ec8100edc3ca04748913e5fe06bd54e286cc7 /fftools
parent8370c9c206367acaec1130fe47582590123b1b64 (diff)
avformat/matroskaenc: Check allocations implicit in dynamic buffers
Failures of the allocations that happen under the hood when using dynamic buffers are usually completely unchecked and the Matroska muxer is no exception to this. The API has its part in this, because there is no documented way to actually check for errors: The return value of both avio_get_dyn_buf() as well as avio_close_dyn_buf() is only documented as "the length of the byte buffer", so that using this to return errors would be an API break. Therefore this commit uses the only reliable way to check for errors with avio_get_dyn_buf(): The AVIOContext's error flag. (This is one of the advantages of avio_get_dyn_buf(): By not destroying the AVIOContext it is possible to inspect this value.) Checking whether the size or the pointer vanishes is not enough as it does not check for truncated output (the dynamic buffer API is int based and so has to truncate the buffer even when enough memory would be available; it's current actual limit is even way below INT_MAX). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'fftools')
0 files changed, 0 insertions, 0 deletions