Browse code

tta: check for extradata allocation failure in tta demuxer (cherry picked from commit f540ca22c5fb4504d959c295f55591a9ec2a8859)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Justin Ruggles authored on 2011/09/24 08:22:06
Showing 1 changed files
... ...
@@ -107,6 +107,10 @@ static int tta_read_header(AVFormatContext *s, AVFormatParameters *ap)
107 107
         return -1;
108 108
     }
109 109
     st->codec->extradata = av_mallocz(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE);
110
+    if (!st->codec->extradata) {
111
+        st->codec->extradata_size = 0;
112
+        return AVERROR(ENOMEM);
113
+    }
110 114
     avio_seek(s->pb, start_offset, SEEK_SET);
111 115
     avio_read(s->pb, st->codec->extradata, st->codec->extradata_size);
112 116