}
}
-static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
+static int avi_read_header(AVFormatContext *s)
{
AVIContext *avi = s->priv_data;
AVIOContext *pb = s->pb;
tag = avio_rl32(pb);
size = avio_rl32(pb);
- if(size > avi->fsize){
- av_log(s, AV_LOG_ERROR, "chunk size is too big during header parsing\n");
- goto fail;
- }
-
print_tag("tag", tag, size);
switch(tag) {
break;
}
- if(size > 10*4 && size<(1<<30)){
+ if(size > 10*4 && size<(1<<30) && size < avi->fsize){
st->codec->extradata_size= size - 10*4;
st->codec->extradata= av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata) {
}
break;
case MKTAG('s', 't', 'r', 'd'):
- if (stream_index >= (unsigned)s->nb_streams || st->codec->extradata_size) {
+ if (stream_index >= (unsigned)s->nb_streams || s->streams[stream_index]->codec->extradata_size) {
avio_skip(pb, size);
} else {
uint64_t cur_pos = avio_tell(pb);
case MKTAG('i', 'n', 'd', 'x'):
i= avio_tell(pb);
if(pb->seekable && !(s->flags & AVFMT_FLAG_IGNIDX) && avi->use_odml &&
- read_braindead_odml_indx(s, 0) < 0 && s->error_recognition >= FF_ER_EXPLODE){
- goto fail; }
+ read_braindead_odml_indx(s, 0) < 0 && (s->error_recognition & AV_EF_EXPLODE))
+ goto fail;
avio_seek(pb, i+size, SEEK_SET);
break;
case MKTAG('v', 'p', 'r', 'p'):
if(size > 1000000){
av_log(s, AV_LOG_ERROR, "Something went wrong during header parsing, "
"I will ignore it and try to continue anyway.\n");
- if (s->error_recognition >= FF_ER_EXPLODE) goto fail;
+ if (s->error_recognition & AV_EF_EXPLODE)
+ goto fail;
avi->movi_list = avio_tell(pb) - 4;
avi->movi_end = avi->fsize;
goto end_of_header;