summaryrefslogtreecommitdiff
path: root/libavutil/bprint.h
Commit message (Collapse)AuthorAge
* avutil/bprint: Allow size == 0 in av_bprint_init_for_buffer()Andreas Rheinhardt2023-08-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The AVBPrint API guarantees that the string buffer is always zero-terminated; in order to honour this guarantee, there obviously must be a string buffer at all and it must have a size >= 1. Therefore av_bprint_init_for_buffer() treats passing a NULL buffer or size == 0 as invalid data that leads to undefined behaviour, namely NPD in case NULL is provided or a write to a buffer of size 0 in case size == 0. But it would be easy to support this, namely by using the internal buffer with AV_BPRINT_SIZE_COUNT_ONLY in case size == 0. There is a reason to allow this: Several functions like av_channel_(description|name) are actually wrappers around corresponding AVBPrint functions. They accept user provided buffers and are supposed to return the required size of the buffer, which would allow the user to call it once to get the required buffer size and call it once more after having allocated the buffer. If av_bprint_init_for_buffer() treats size == 0 as invalid, all these users would need to check for this themselves and basically add the same codeblock that this patch adds to av_bprint_init_for_buffer(). This change is in line with e.g. snprintf() which also allows the pointer to be NULL in case size is zero. This fixes Coverity issues #1503074, #1503076 and #1503082; all of these issues are about providing NULL to the channel-layout functions that are wrappers around AVBPrint versions. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/bprint: Improve doxy documentationMarvin Scholz2022-10-17
| | | | | | | Declare proper group, add the file to that group, group the defines and document them. Use lists to represents lists of cases.
* avutil/bprint: C++ compatible AVBPrint definition.Vadim Kalinsky2014-11-29
| | | | | Previous version reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavu/bprint: add const to av_bprint_is_complete() argument.Nicolas George2014-09-21
|
* avutil & avdevice: remove av_bprint_fd_contents()Michael Niedermayer2014-07-15
| | | | | | | | | | | | MSVC does not allow passing file pointers between libs This API can thus not work with MSVC and as it was very recently added and its it was in no release its removial should not cause any problems A better API will be implemented, but its not finished yet, this revert is to avoid potentially blocking the release Found-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avutil/bprint: Add av_bprint_fd_contents()Andrey Utkin2014-07-07
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavu/bprint: add append buffer functionLukasz Marek2013-08-30
| | | | | | Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com> Reveiwed-by: Nicolas George <nicolas.george@normalesup.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avutil/bprint: add av_vbprintf()Michael Niedermayer2013-08-10
| | | | | Reviewed-by: Nicolas George <nicolas.george@normalesup.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avutil/bprint: Fix doxygen commentsMichael Niedermayer2013-05-24
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavu: add escape APIStefano Sabatini2013-03-07
| | | | | | | | The escape API will be useful to perform escaping programmatically, which is required when crafting argument strings, and will be used for context printing as well. This is based on the ffescape tool code, with a few extensions and fixes.
* lavu/bprint: implement av_bprint_strftime().Nicolas George2012-11-17
|
* lavu/bprint: add av_bprint_get_buffer().Nicolas George2012-11-02
| | | | | It is useful to use bprint to handle a growing buffer used with another API.
* lavu/bprint: readd documentation for 0 and 1 av_bprint_init() special valuesStefano Sabatini2012-07-31
| | | | The documentation was erroneously removed in 7cf9aadd.
* lavu/bprint: extend/clarify documentation for av_bprint_init() size_max valueStefano Sabatini2012-07-28
| | | | | Also define AV_BPRINT_SIZE_* macros before av_bprint_init() declaration, and mention them in the av_bprint_init() doxy.
* bprint: add av_bprint_init_for_buffer().Nicolas George2012-06-07
|
* lavu/bprint: add av_bprint_reset().Clément Bœsch2012-05-14
|
* lavu: add av_bprintf and related.Nicolas George2012-03-21