diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-30 00:31:22 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-12-30 04:44:47 +0400 |
commit | b9e0e9537a3ec4af1630e9f1b8d0ce68885cac16 (patch) | |
tree | 55f98446ef13e9841bbe9631524bc8f47c558994 /libavformat | |
parent | 3a15051aba3c071ac1bff5ea91151a909dfa9257 (diff) |
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>
Diffstat (limited to 'libavformat')
-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) { |