Commit d8f27ece authored by Michael Niedermayer's avatar Michael Niedermayer

asfdec: ignore stored duration for truncated files

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8469fc17
...@@ -351,8 +351,10 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size) ...@@ -351,8 +351,10 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
asf_st->stream_language_index = 128; // invalid stream index means no language info asf_st->stream_language_index = 128; // invalid stream index means no language info
if(!(asf->hdr.flags & 0x01)) { // if we aren't streaming... if(!(asf->hdr.flags & 0x01)) { // if we aren't streaming...
st->duration = asf->hdr.play_time / int64_t fsize = avio_size(pb);
(10000000 / 1000) - start_time; if (fsize <= 0 || asf->hdr.file_size <= 0 || FFABS(fsize - asf->hdr.file_size) < 10000)
st->duration = asf->hdr.play_time /
(10000000 / 1000) - start_time;
} }
ff_get_guid(pb, &g); ff_get_guid(pb, &g);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment