[FFmpeg-cvslog] westwood_vqa: check return value of av_malloc()
Paul B Mahol
git at videolan.org
Tue Jul 2 00:19:22 CEST 2013
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Jul 1 22:15:25 2013 +0000| [e1b0d3a389ff7050c66f43891539200eddf4af15] | committer: Paul B Mahol
westwood_vqa: check return value of av_malloc()
Signed-off-by: Paul B Mahol <onemda at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e1b0d3a389ff7050c66f43891539200eddf4af15
---
libavformat/westwood_vqa.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavformat/westwood_vqa.c b/libavformat/westwood_vqa.c
index c996dad..00e95cd 100644
--- a/libavformat/westwood_vqa.c
+++ b/libavformat/westwood_vqa.c
@@ -101,8 +101,10 @@ static int wsvqa_read_header(AVFormatContext *s)
avio_seek(pb, 20, SEEK_SET);
/* the VQA header needs to go to the decoder */
- st->codec->extradata_size = VQA_HEADER_SIZE;
st->codec->extradata = av_mallocz(VQA_HEADER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!st->codec->extradata)
+ return AVERROR(ENOMEM);
+ st->codec->extradata_size = VQA_HEADER_SIZE;
header = (unsigned char *)st->codec->extradata;
if (avio_read(pb, st->codec->extradata, VQA_HEADER_SIZE) !=
VQA_HEADER_SIZE) {
More information about the ffmpeg-cvslog
mailing list