summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-29 21:31:22 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-03 22:41:16 +0100
commit53c430415a65cb4097bdb59b924aaa09bc5e2bb2 (patch)
tree1e941ee857a8006d7be562769efa7fb4f728ed10
parentf246d46ee66678bdd23e939aaede28943cfeb8da (diff)
downloadffmpeg-53c430415a65cb4097bdb59b924aaa09bc5e2bb2.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> (cherry picked from commit b9e0e9537a3ec4af1630e9f1b8d0ce68885cac16) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/nsvdec.c2
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) {