Mercurial > libavformat.hg
comparison westwood.c @ 884:2ece9c9dd94c libavformat
malloc padding to avoid reading past the malloc()ed area.
Credits to Mikulas Patocka (mikulas at artax karlin mff cuni cz)
author | henry |
---|---|
date | Sat, 17 Dec 2005 17:57:03 +0000 |
parents | feca73904e67 |
children | da1d5db0ce5c |
comparison
equal
deleted
inserted
replaced
883:778e090e879d | 884:2ece9c9dd94c |
---|---|
229 /* skip to the start of the VQA header */ | 229 /* skip to the start of the VQA header */ |
230 url_fseek(pb, 20, SEEK_SET); | 230 url_fseek(pb, 20, SEEK_SET); |
231 | 231 |
232 /* the VQA header needs to go to the decoder */ | 232 /* the VQA header needs to go to the decoder */ |
233 st->codec->extradata_size = VQA_HEADER_SIZE; | 233 st->codec->extradata_size = VQA_HEADER_SIZE; |
234 st->codec->extradata = av_malloc(VQA_HEADER_SIZE); | 234 st->codec->extradata = av_mallocz(VQA_HEADER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE); |
235 header = (unsigned char *)st->codec->extradata; | 235 header = (unsigned char *)st->codec->extradata; |
236 if (get_buffer(pb, st->codec->extradata, VQA_HEADER_SIZE) != | 236 if (get_buffer(pb, st->codec->extradata, VQA_HEADER_SIZE) != |
237 VQA_HEADER_SIZE) { | 237 VQA_HEADER_SIZE) { |
238 av_free(st->codec->extradata); | 238 av_free(st->codec->extradata); |
239 return AVERROR_IO; | 239 return AVERROR_IO; |