diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-06-22 20:33:09 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-08-13 13:08:57 +0200 |
commit | c34f0616d9c7c2e903a026182cf4630c75cdeee8 (patch) | |
tree | 974f8cbd8cc4d4c5f83990293e24f0caee50d777 | |
parent | 96ce6f64cc33e7d599d9b98e15d9fc2e3e28cb69 (diff) | |
download | ffmpeg-c34f0616d9c7c2e903a026182cf4630c75cdeee8.tar.gz |
avformat/flacdec: Fix seeking close to EOF
Fixes Ticket5428
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d0b21b28a3d348c0302c98cee23c4820cd13e1e2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/flacdec.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c index eb92216c45..46c51a6453 100644 --- a/libavformat/flacdec.c +++ b/libavformat/flacdec.c @@ -259,8 +259,10 @@ static av_unused int64_t flac_read_timestamp(AVFormatContext *s, int stream_inde if (ret < 0){ if (ret == AVERROR(EAGAIN)) continue; - else - break; + else { + av_packet_unref(&pkt); + av_assert1(!pkt.size); + } } av_init_packet(&out_pkt); av_parser_parse2(parser, st->codec, @@ -277,7 +279,8 @@ static av_unused int64_t flac_read_timestamp(AVFormatContext *s, int stream_inde pts = parser->pts; break; } - } + } else if (ret < 0) + break; } av_parser_close(parser); return pts; |