Browse Source

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>
tags/n4.4
Andreas Rheinhardt 4 years ago
parent
commit
c2649d5196
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavutil/avstring.c

+ 1
- 1
libavutil/avstring.c View File

@@ -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)) {


Loading…
Cancel
Save