]> git.sesse.net Git - ffmpeg/commitdiff
nsvdec: Check av_malloc(string_size)
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 29 Dec 2011 20:31:22 +0000 (21:31 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 30 Dec 2011 00:44:47 +0000 (01:44 +0100)
This can easily be NULL as string_size can be 2g in a damaged file.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/nsvdec.c

index 72d626af7347f57b1c6f0dae55c36b930c66ab94..76bcd4a5ea1a164961ab2d078585342392742000 100644 (file)
@@ -314,6 +314,8 @@ static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap)
         char quote;
 
         p = strings = av_mallocz(strings_size + 1);
+        if (!p)
+            return AVERROR(ENOMEM);
         endp = strings + strings_size;
         avio_read(pb, strings, strings_size);
         while (p < endp) {