summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <[email protected]>2015-03-08 23:31:48 +0100
committerMichael Niedermayer <[email protected]>2015-03-14 14:27:23 +0100
commit88cc4a405a4602edf49832cccb6a4c7ffd266b2d (patch)
tree850f221e11de35d2214ba1df16d7d9dbf51a85a1
parent5537faaf19d36a4e89b10d832c0dc2aca6171629 (diff)
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 <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit 6fa98822eba501a4898fdec5b75acd3026201005) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavformat/ffmdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 91882b2a72..338a8502e7 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -356,7 +356,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 */
@@ -488,7 +488,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 */