diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2009-10-22 18:43:08 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2009-10-22 18:43:08 +0000 |
commit | df84d7d9bdf6b8e6896c711880f130b72738c828 (patch) | |
tree | 1bd82cef1345c2b9dc198c56260ec4405baa5178 /libavformat | |
parent | 83a4d356ef6f81508faf58930b3c9ec22ff5d239 (diff) | |
download | ffmpeg-df84d7d9bdf6b8e6896c711880f130b72738c828.tar.gz |
Fix infinite loop with size==0 && sample_size!=0 in non interleaved avis.
Untested, i do not have a sample.
Originally committed as revision 20348 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/avidec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 37d15c2e7d..5be93949f7 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -170,7 +170,7 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num){ if(last_pos == pos || pos == base - 8) avi->non_interleaved= 1; - if(last_pos != pos) + if(last_pos != pos && (len || !ast->sample_size)) av_add_index_entry(st, pos, ast->cum_len, len, 0, key ? AVINDEX_KEYFRAME : 0); if(ast->sample_size) @@ -905,7 +905,7 @@ resync: ast->packet_size= size + 8; ast->remaining= size; - { + if(size || !ast->sample_size){ uint64_t pos= url_ftell(pb) - 8; if(!st->index_entries || !st->nb_index_entries || st->index_entries[st->nb_index_entries - 1].pos < pos){ av_add_index_entry(st, pos, ast->frame_offset, size, 0, AVINDEX_KEYFRAME); @@ -964,7 +964,7 @@ static int avi_read_idx1(AVFormatContext *s, int size) if(last_pos == pos) avi->non_interleaved= 1; - else + else if(len || !ast->sample_size) av_add_index_entry(st, pos, ast->cum_len, len, 0, (flags&AVIIF_INDEX) ? AVINDEX_KEYFRAME : 0); if(ast->sample_size) ast->cum_len += len; |