aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/avidec.c
diff options
context:
space:
mode:
authorDustin Brody <libav@parsoma.net>2011-08-06 04:42:34 +0000
committerAnton Khirnov <anton@khirnov.net>2011-08-12 19:10:22 +0200
commit2f63440c59bf8c4a2e90280e23e8cadb235a42e6 (patch)
treee2ef08ef74514f19a737dc5eaff5726e9742788c /libavformat/avidec.c
parent8d2e4a7e687b7fdbb939e236399cf774dc7bead6 (diff)
downloadffmpeg-2f63440c59bf8c4a2e90280e23e8cadb235a42e6.tar.gz
lavf: add support for error_recognition, use it in avidec, and bump minor API version
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/avidec.c')
-rw-r--r--libavformat/avidec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 0ea093c6d7..8c0ef13b14 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -667,8 +667,9 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
break;
case MKTAG('i', 'n', 'd', 'x'):
i= avio_tell(pb);
- if(pb->seekable && !(s->flags & AVFMT_FLAG_IGNIDX)){
- read_braindead_odml_indx(s, 0);
+ if(pb->seekable && !(s->flags & AVFMT_FLAG_IGNIDX) &&
+ read_braindead_odml_indx(s, 0) < 0 && s->error_recognition >= FF_ER_EXPLODE){
+ goto fail;
}
avio_seek(pb, i+size, SEEK_SET);
break;
@@ -706,6 +707,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
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;
avi->movi_list = avio_tell(pb) - 4;
avi->movi_end = avio_size(pb);
goto end_of_header;