Browse Source

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 b9e0e9537a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.9.1
Michael Niedermayer 14 years ago
parent
commit
53c430415a
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavformat/nsvdec.c

+ 2
- 0
libavformat/nsvdec.c View 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) {


Loading…
Cancel
Save