summaryrefslogtreecommitdiff
path: root/libavutil/avstring.c
Commit message (Collapse)AuthorAgeFilesLines
* avutil: remove FF_API_D2STRJames Almer2023-02-091-10/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* Remove unnecessary libavutil/(avutil|common|internal).h inclusionsAndreas Rheinhardt2022-02-241-1/+4
| | | | | | | | | | Some of these were made possible by moving several common macros to libavutil/macros.h. While just at it, also improve the other headers a bit. Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/avstring: Check for memory allocation error in av_escapeAndreas Rheinhardt2021-03-151-3/+4
| | | | | | | | av_bprint_finalize() can still fail even when it has been checked that the AVBPrint is currently complete: Namely if the string was so short that it fit into the AVBPrint's internal buffer. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avutil/avstring: Limit string length in av_escape to range of intAndreas Rheinhardt2021-03-151-1/+1
| | | | | | Otherwise the caller can't distinguish the return value from an error. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavu/avstring: deprecate av_d2str().Nicolas George2020-08-211-0/+2
| | | | | It is no longer used in our code base and does not seem to be used much in other projects.
* avutil/avstring: Fix warning: ISO C90 forbids mixed declarations and codeLimin Wang2020-01-141-3/+5
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/avstring: support input path as a null pointer or empty stringLimin Wang2019-10-081-4/+8
| | | | | | | | | | | | | | | Linux and OSX systems support basename and dirname via <libgen.h>, I plan to make the wrapper interface conform to the standard interface first. If it is feasible, I will continue to modify it to call the system interface if there is already a system call interface. You can get more description about the system interface by below command: "man 3 basename" Reviewed-by: Marton Balint <cus@passwd.hu> Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avutil/avstring: Fix bug and undefined behavior in av_strncasecmp()Michael Niedermayer2019-04-241-2/+3
| | | | | | | | | The function in case of n=0 would read more bytes than 0. The end pointer could be beyond the allocated space, which is undefined. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/avstring: improve av_strreplace implementSteven Liu2017-04-111-65/+11
| | | | | | | | Use AVBprint to implement av_strreplace add av_strreplace test case TEST_STRREPLACE Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avutil/avstring: add av_strreplace API into avstringSteven Liu2017-04-011-0/+77
| | | | | | | refer to: http://creativeandcritical.net/str-replace-c add av_strreplace API for replace string operations. Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13'Derek Buitenhuis2016-05-111-64/+0
|\ | | | | | | | | | | | | | | * commit 'd12b5b2f135aade4099f4b26b0fe678656158c13': build: Split test programs off into separate files Some conversions done by: James Almer <jamrial@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * build: Split test programs off into separate filesDiego Biurrun2016-04-071-52/+0
| | | | | | | | | | This avoids spurious library rebuilds when only the test program code is changed and simplifies the build system.
| * avutil/avstring: Inline some tiny functionsHenrik Gramner2015-10-031-22/+0
| | | | | | | | | | | | | | They're short enough that inlining them actually reduces code size due to all the overhead associated with making a function call. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | avutil/parsing: add '\r' as whitespaceMuhammad Faiz2016-05-061-1/+1
| | | | | | | | | | | | | | for compatibility with platforms that treat it as newline Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
* | avutil/avstring: add a "ALL" entry and the possibility to negate matches to ↵Michael Niedermayer2016-02-131-5/+10
| | | | | | | | | | | | | | | | | | | | av_match_name() This will extend the whitelist features to allow blacklisting individual protocols and to explicitly force everything to be enabled. Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/avstring: Inline some tiny functionsHenrik Gramner2015-09-261-22/+0
| | | | | | | | | | They're short enough that inlining them actually reduces code size due to all the overhead associated with making a function call.
* | avutil/avstring: Do not print NULLMichael Niedermayer2015-06-191-1/+1
| | | | | | | | | | | | | | Fixes segfault Fixes Ticket4452 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/avstring: Fix undefined shiftMichael Niedermayer2015-06-191-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/avstring: Use size_t in av_strlcatf()Michael Niedermayer2015-05-111-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavu/avstring: add av_append_path_component() funcionLukasz Marek2015-03-311-0/+45
| | | | | | | | | | | | Convinient function to build paths. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/avstring: fix hardcoded separator in av_match_list()Michael Niedermayer2014-10-231-4/+4
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/avstring: Reimplement av_match_list()Michael Niedermayer2014-10-231-15/+14
| | | | | | | | | | | | | | av_match_list() is only used for whitelists, fix it so it works with multi-named formats like "mov,mp4,m4a,3gp,3g2,mj2" Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/avstring: Factor av_match_list() outMichael Niedermayer2014-10-021-0/+21
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavu/avstring: check for overlong encodings in av_utf8_decode()Stefano Sabatini2014-09-011-1/+14
| | | | | | | | Fix reopened trac ticket #1163.
* | Merge commit '69e7336b8e16ee65226fc20381baf537f4b125e6'Michael Niedermayer2014-07-291-0/+18
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | * commit '69e7336b8e16ee65226fc20381baf537f4b125e6': avstring: Expose the simple name match function Conflicts: libavutil/avstring.c libavutil/avstring.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avstring: Expose the simple name match functionLuca Barbato2014-07-291-0/+20
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * avstring-test: Mark pointer passed to av_free() as non-constDiego Biurrun2013-10-231-1/+2
| | | | | | | | libavutil/avstring.c:278:9: warning: passing argument 1 of ‘av_free’ discards ‘const’ qualifier from pointer target type
* | avutil/avstring: do not lose ascii characters when decoding non utf-8 with ↵Michael Niedermayer2014-04-131-4/+4
| | | | | | | | | | | | | | | | av_utf8_decode() Fixes Ticket3363 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/avstring: fix () positionMichael Niedermayer2013-12-111-2/+2
| | | | | | | | | | | | Fixes CID1135751 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavu/avstring: add av_utf8_decode() functionStefano Sabatini2013-11-221-0/+64
| |
* | avutil/avstring: make const tables static constMichael Niedermayer2013-08-111-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '4be368b504c6f4a03051448728fc62cd0ed506b2'Michael Niedermayer2013-03-081-1/+1
|\ \ | |/ | | | | | | | | | | | | * commit '4be368b504c6f4a03051448728fc62cd0ed506b2': avstring: Fix isxdigit to not accept non-hex characters configure: Add missing videodsp dependencies to some decoders Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avstring: Fix isxdigit to not accept non-hex charactersMartin Storsjö2013-03-071-1/+1
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'efa7f4202088c70caba11d7834641bc6eaf41830'Michael Niedermayer2013-03-081-0/+22
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'efa7f4202088c70caba11d7834641bc6eaf41830': Use the avstring.h locale-independent character type functions avstring: Add locale independent versions of some ctype.h functions Conflicts: avprobe.c doc/APIchanges libavcodec/dvdsubdec.c libavcodec/utils.c libavutil/avstring.c libavutil/avstring.h libavutil/eval.c libavutil/parseutils.c libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Use the avstring.h locale-independent character type functionsReimar Döffinger2013-03-071-2/+1
| | | | | | | | | | | | Make sure the behavior does not change with the locale. Signed-off-by: Martin Storsjö <martin@martin.st>
| * avstring: Add locale independent versions of some ctype.h functionsReimar Döffinger2013-03-071-0/+22
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | lavu: add escape APIStefano Sabatini2013-03-071-0/+18
| | | | | | | | | | | | | | | | 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.
* | Remove incorrect use of ctype.h functions.Reimar Döffinger2013-03-031-2/+1
| | | | | | | | | | | | | | As far as I can tell the code should not change behaviour depending on locale in any of these places. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | avstring: fix "warning: return discards const qualifier from pointer target ↵Michael Niedermayer2013-01-301-2/+2
| | | | | | | | | | | | type" Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'b85a5e87af4254b80913fe33591d96361f30832b'Michael Niedermayer2013-01-251-0/+14
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'b85a5e87af4254b80913fe33591d96361f30832b': lavu: Add av_strnstr() h264: Allow discarding the cropping information from SPS Conflicts: Changelog doc/APIchanges libavcodec/avcodec.h libavcodec/version.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavu: Add av_strnstr()Vladimir Pantelic2013-01-251-0/+14
| | | | | | | | | | | | | | This is a length limited version of strstr() Signed-off-by: Vladimir Pantelic <vladoman@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '33552a5f7b6ec7057516f487b1a902331f8c353e'Michael Niedermayer2013-01-251-60/+57
|\ \ | |/ | | | | | | | | | | | | | | | | | | * commit '33552a5f7b6ec7057516f487b1a902331f8c353e': arm: Add mathops.h to ARCH_HEADERS list avstring: K&R formatting cosmetics Conflicts: libavutil/avstring.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avstring: K&R formatting cosmeticsLuca Barbato2013-01-241-59/+56
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit '6dd93ee6f1b050ad7c4b247899e83efa293ee405'Michael Niedermayer2012-12-301-0/+41
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | * commit '6dd93ee6f1b050ad7c4b247899e83efa293ee405': hlsenc: check append_entry return value hlsenc: use the basename to generate the list entries avstring: add av_basename and av_dirname Conflicts: Changelog doc/APIchanges libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avstring: add av_basename and av_dirnameLuca Barbato2012-12-291-0/+41
| | | | | | | | Thread safe version of the common basename and dirname.
* | Merge commit 'cb45553f577f8e0ebfe05d3287e1b6fa5859b967'Michael Niedermayer2012-12-051-1/+0
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'cb45553f577f8e0ebfe05d3287e1b6fa5859b967': Remove pointless #undefs of previously forbidden functions. fate: Add dependencies for bmp, cdxl, dfa, mp3 Conflicts: doc/examples/muxing.c libavfilter/filtfmts.c libavutil/des.c libavutil/eval.c libavutil/log.c libavutil/parseutils.c tests/fate/mp3.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Remove pointless #undefs of previously forbidden functions.Anton Khirnov2012-12-041-1/+0
| |
* | avstring: fix compiler warning about freeing const pointersMichael Niedermayer2012-11-031-1/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'f5962229bfcb14c2879e69ccdf7f1a4934168609'Michael Niedermayer2012-10-131-2/+4
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f5962229bfcb14c2879e69ccdf7f1a4934168609': avplay: use audio parameters from the decoded frame instead of AVCodecContext dca: allocate a secondary buffer for extra channels when downmixing configure: use utilities from /usr/xpg4/bin if it exists avstring-test: fix memory leaks Conflicts: ffplay.c libavcodec/dcadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avstring-test: fix memory leaksMans Rullgard2012-10-121-2/+4
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>