diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-29 21:31:22 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-12-30 01:44:47 +0100 |
commit | b9e0e9537a3ec4af1630e9f1b8d0ce68885cac16 (patch) | |
tree | 55f98446ef13e9841bbe9631524bc8f47c558994 | |
parent | 3a15051aba3c071ac1bff5ea91151a909dfa9257 (diff) | |
download | ffmpeg-b9e0e9537a3ec4af1630e9f1b8d0ce68885cac16.tar.gz |
nsvdec: Check av_malloc(string_size)
This can easily be NULL as string_size can be 2g in a damaged file.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/nsvdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c index 72d626af73..76bcd4a5ea 100644 --- a/libavformat/nsvdec.c +++ b/libavformat/nsvdec.c @@ -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) { |