[FFmpeg-cvslog] avformat/flacdec: Fix seeking close to EOF

Michael Niedermayer git at videolan.org
Sat Aug 13 16:30:03 EEST 2016


ffmpeg | branch: release/3.0 | Michael Niedermayer <michael at niedermayer.cc> | Wed Jun 22 20:33:09 2016 +0200| [c34f0616d9c7c2e903a026182cf4630c75cdeee8] | committer: Michael Niedermayer

avformat/flacdec: Fix seeking close to EOF

Fixes Ticket5428

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit d0b21b28a3d348c0302c98cee23c4820cd13e1e2)

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c34f0616d9c7c2e903a026182cf4630c75cdeee8
---

 libavformat/flacdec.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c
index eb92216..46c51a6 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;



More information about the ffmpeg-cvslog mailing list