diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-03-09 21:17:12 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-03-15 06:44:03 +0100 |
commit | c2649d5196843db46d25a9f9f6f9272a464221b7 (patch) | |
tree | 076f0912065d37df2f96c72a25b4492f3e1c9cd6 /libavutil | |
parent | a581370f54b6d67270ec228c05e8c00619b2162b (diff) | |
download | ffmpeg-c2649d5196843db46d25a9f9f6f9272a464221b7.tar.gz |
avutil/avstring: Limit string length in av_escape to range of int
Otherwise the caller can't distinguish the return value from an error.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/avstring.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/avstring.c b/libavutil/avstring.c index e33d4aac51..832bec750f 100644 --- a/libavutil/avstring.c +++ b/libavutil/avstring.c @@ -337,7 +337,7 @@ int av_escape(char **dst, const char *src, const char *special_chars, { AVBPrint dstbuf; - av_bprint_init(&dstbuf, 1, AV_BPRINT_SIZE_UNLIMITED); + av_bprint_init(&dstbuf, 1, INT_MAX); /* (int)dstbuf.len must be >= 0 */ av_bprint_escape(&dstbuf, src, special_chars, mode, flags); if (!av_bprint_is_complete(&dstbuf)) { |