Mercurial > libavformat.hg
changeset 4554:e219c0cdcf8a libavformat
Check for EOF during index reading.
author | michael |
---|---|
date | Sat, 21 Feb 2009 20:44:39 +0000 |
parents | 86e891c581e0 |
children | fd360a55f56d |
files | avidec.c |
diffstat | 1 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/avidec.c Sat Feb 21 20:11:47 2009 +0000 +++ b/avidec.c Sat Feb 21 20:44:39 2009 +0000 @@ -165,6 +165,9 @@ #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 @@ 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 @@ #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