[FFmpeg-cvslog] avidec: move eof check before continue.
Michael Niedermayer
git at videolan.org
Tue Dec 20 17:18:47 CET 2011
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Dec 20 16:52:42 2011 +0100| [3c7f75bd84b4c30a0f86a491a37f759dfaaab86d] | committer: Michael Niedermayer
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 at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3c7f75bd84b4c30a0f86a491a37f759dfaaab86d
---
libavformat/avidec.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index ec543d7..9191b62 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;
More information about the ffmpeg-cvslog
mailing list