avformat/mlvdec: read_string() received unsigned size, make the argument unsigned
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 16 Aug 2018 13:36:28 +0000 (15:36 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 28 Oct 2018 00:22:42 +0000 (02:22 +0200)
Fixes: infinite loop
Fixes: mlv-timeout-e3b8cab9835edecad6823baa057e029671329d04

Found-by: Paul Ch <paulcher@icloud.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1e71cb2c8edcf3dad657c15a6fb8572862f2afb9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/mlvdec.c

index 319cd26..6d774a1 100644 (file)
@@ -77,7 +77,7 @@ static int check_file_header(AVIOContext *pb, uint64_t guid)
     return 0;
 }
 
-static void read_string(AVFormatContext *avctx, AVIOContext *pb, const char *tag, int size)
+static void read_string(AVFormatContext *avctx, AVIOContext *pb, const char *tag, unsigned size)
 {
     char * value = av_malloc(size + 1);
     if (!value) {