Commit 6fa98822 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun Committed by Michael Niedermayer

ffmdec: fix infinite loop at EOF

If EOF is reached, while skipping bytes, avio_tell(pb) won't change
anymore, resulting in an infinite loop.
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 66879ee1
......@@ -434,7 +434,7 @@ static int ffm2_read_header(AVFormatContext *s)
}
/* get until end of block reached */
while ((avio_tell(pb) % ffm->packet_size) != 0)
while ((avio_tell(pb) % ffm->packet_size) != 0 && !pb->eof_reached)
avio_r8(pb);
/* init packet demux */
......@@ -561,7 +561,7 @@ static int ffm_read_header(AVFormatContext *s)
}
/* get until end of block reached */
while ((avio_tell(pb) % ffm->packet_size) != 0)
while ((avio_tell(pb) % ffm->packet_size) != 0 && !pb->eof_reached)
avio_r8(pb);
/* init packet demux */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment