From a32dbf2aed3bb720a28141e1e84284ade3969a49 Mon Sep 17 00:00:00 2001 From: Andreas Cadhalpun Date: Wed, 6 Jan 2016 21:09:19 +0100 Subject: asfdec: break if EOF is reached after asf_read_packet_header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit asf_read_payload can unset eof_reached, so check it also before calling that function. This fixes infinite loops. Signed-off-by: Andreas Cadhalpun Signed-off-by: Alexandra Hájková Signed-off-by: Luca Barbato --- libavformat/asfdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index 90a1df4..460df2a 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -1425,6 +1425,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 -- cgit v1.1