Commit 56291434 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/flvdec: Use the first index entry to find the first packet if there...

avformat/flvdec: Use the first index entry to find the first packet if there was a parsing error in the header

Fixes: unknow_codec.flv
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent fd6296e4
...@@ -854,6 +854,13 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -854,6 +854,13 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
meta_pos = avio_tell(s->pb); meta_pos = avio_tell(s->pb);
type = flv_read_metabody(s, next); type = flv_read_metabody(s, next);
if (type == 0 && dts == 0 || type < 0 || type == TYPE_UNKNOWN) { if (type == 0 && dts == 0 || type < 0 || type == TYPE_UNKNOWN) {
if (type < 0 && flv->validate_count &&
flv->validate_index[0].pos > next &&
flv->validate_index[0].pos - 4 < next
) {
av_log(s, AV_LOG_WARNING, "Adjusting next position due to index mismatch\n");
next = flv->validate_index[0].pos - 4;
}
goto skip; goto skip;
} else if (type == TYPE_ONTEXTDATA) { } else if (type == TYPE_ONTEXTDATA) {
avpriv_request_sample(s, "OnTextData packet"); avpriv_request_sample(s, "OnTextData packet");
......
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