aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-20 16:52:42 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-03 19:55:54 +0100
commitd561025e4914bb1542afde08e9edd2db4eb5ae80 (patch)
treed4fd9e9d9ad516c40e1d80ed45657ff6b69179dd
parent61fb7e17a25b62c3bbc9f72e3a23baca2a5beed9 (diff)
downloadffmpeg-d561025e4914bb1542afde08e9edd2db4eb5ae80.tar.gz
avidec: move eof check before continue.
Fixes a infinite loop Fixes half of Ticket800 Bug found by Oana Stratulat Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 3c7f75bd84b4c30a0f86a491a37f759dfaaab86d) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/avidec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 1a73161add..4bf1fd6916 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -1232,6 +1232,9 @@ static int avi_read_idx1(AVFormatContext *s, int size)
/* Read the entries and sort them in each stream component. */
for(i = 0; i < nb_index_entries; i++) {
+ if(url_feof(pb))
+ return -1;
+
tag = avio_rl32(pb);
flags = avio_rl32(pb);
pos = avio_rl32(pb);
@@ -1254,8 +1257,6 @@ static int avi_read_idx1(AVFormatContext *s, int size)
av_dlog(s, "%d cum_len=%"PRId64"\n", len, ast->cum_len);
- if(url_feof(pb))
- return -1;
if(last_pos == pos)
avi->non_interleaved= 1;