[FFmpeg-cvslog] asfdec_o: break if EOF is reached after asf_read_packet_header

Andreas Cadhalpun git at videolan.org
Thu Jan 28 00:44:37 CET 2016


ffmpeg | branch: release/2.8 | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Wed Jan  6 18:44:33 2016 +0100| [93559adfbfd42c8fb05cd5dc2c7cde866d3dbe87] | committer: Andreas Cadhalpun

asfdec_o: break if EOF is reached after asf_read_packet_header

asf_read_payload can unset eof_reached, so check it also before calling
that function.

This fixes infinite loops.

Reviewed-by: Alexandra Hájková <alexandra.khirnova at gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
(cherry picked from commit 0e32153e9c296366e004352ecb3f9fcea74dc17d)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>

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

 libavformat/asfdec_o.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
index 2b3d9e6..f8e5e1e 100644
--- a/libavformat/asfdec_o.c
+++ b/libavformat/asfdec_o.c
@@ -1434,6 +1434,8 @@ static int asf_read_packet(AVFormatContext *s, AVPacket *pkt)
     while (!pb->eof_reached) {
         if (asf->state == PARSE_PACKET_HEADER) {
             asf_read_packet_header(s);
+            if (pb->eof_reached)
+                break;
             if (!asf->nb_mult_left)
                 asf->state = READ_SINGLE;
             else



More information about the ffmpeg-cvslog mailing list