mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
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: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6fa98822eb
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
2319fddfd3
commit
1903d6d2b0
@ -434,7 +434,7 @@ static int ffm2_read_header(AVFormatContext *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* get until end of block reached */
|
/* 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);
|
avio_r8(pb);
|
||||||
|
|
||||||
/* init packet demux */
|
/* init packet demux */
|
||||||
@ -561,7 +561,7 @@ static int ffm_read_header(AVFormatContext *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* get until end of block reached */
|
/* 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);
|
avio_r8(pb);
|
||||||
|
|
||||||
/* init packet demux */
|
/* init packet demux */
|
||||||
|
Loading…
Reference in New Issue
Block a user