aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/asfdec_o.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-01-06 18:44:33 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-01-15 00:39:46 +0100
commit0e32153e9c296366e004352ecb3f9fcea74dc17d (patch)
tree593409c6b35199408617ac7a4ea75ae9ea748cd1 /libavformat/asfdec_o.c
parent3776a72962b0622af17c4aef89a831da2cbaceca (diff)
downloadffmpeg-0e32153e9c296366e004352ecb3f9fcea74dc17d.tar.gz
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@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavformat/asfdec_o.c')
-rw-r--r--libavformat/asfdec_o.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
index 4a3c81501e..ca4a06652e 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