Commit d0b21b28 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/flacdec: Fix seeking close to EOF

Fixes Ticket5428
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent b0b3676e
...@@ -259,8 +259,10 @@ static av_unused int64_t flac_read_timestamp(AVFormatContext *s, int stream_inde ...@@ -259,8 +259,10 @@ static av_unused int64_t flac_read_timestamp(AVFormatContext *s, int stream_inde
if (ret < 0){ if (ret < 0){
if (ret == AVERROR(EAGAIN)) if (ret == AVERROR(EAGAIN))
continue; continue;
else else {
break; av_packet_unref(&pkt);
av_assert1(!pkt.size);
}
} }
av_init_packet(&out_pkt); av_init_packet(&out_pkt);
av_parser_parse2(parser, st->internal->avctx, av_parser_parse2(parser, st->internal->avctx,
...@@ -277,7 +279,8 @@ static av_unused int64_t flac_read_timestamp(AVFormatContext *s, int stream_inde ...@@ -277,7 +279,8 @@ static av_unused int64_t flac_read_timestamp(AVFormatContext *s, int stream_inde
pts = parser->pts; pts = parser->pts;
break; break;
} }
} } else if (ret < 0)
break;
} }
av_parser_close(parser); av_parser_close(parser);
return pts; return pts;
......
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