aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/avidec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2009-02-21 20:44:39 +0000
committerMichael Niedermayer <michaelni@gmx.at>2009-02-21 20:44:39 +0000
commit8ebe099ac0c0ca68161c54efc76ea6a7a87f81ce (patch)
treee55ca1e8813cf80597af2dd6b80dae82ffc94756 /libavformat/avidec.c
parenta90de11dba816f57d01cf10b02eaaf90de24d5bb (diff)
downloadffmpeg-8ebe099ac0c0ca68161c54efc76ea6a7a87f81ce.tar.gz
Check for EOF during index reading.
Originally committed as revision 17496 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avidec.c')
-rw-r--r--libavformat/avidec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 3526700ba7..4a28890407 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -165,6 +165,9 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num){
#ifdef DEBUG_SEEK
av_log(s, AV_LOG_ERROR, "pos:%"PRId64", len:%X\n", pos, len);
#endif
+ if(url_feof(pb))
+ return -1;
+
if(last_pos == pos || pos == base - 8)
avi->non_interleaved= 1;
if(last_pos != pos)
@@ -181,6 +184,10 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num){
offset = get_le64(pb);
get_le32(pb); /* size */
duration = get_le32(pb);
+
+ if(url_feof(pb))
+ return -1;
+
pos = url_ftell(pb);
url_fseek(pb, offset+8, SEEK_SET);
@@ -923,6 +930,9 @@ static int avi_read_idx1(AVFormatContext *s, int size)
#if defined(DEBUG_SEEK)
av_log(s, AV_LOG_DEBUG, "%d cum_len=%"PRId64"\n", len, ast->cum_len);
#endif
+ if(url_feof(pb))
+ return -1;
+
if(last_pos == pos)
avi->non_interleaved= 1;
else