mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-16 12:00:06 +01:00
avidec: avoid infinite loop due to negative ast->sample_size
If max in clean_index is set to a negative ast->sample_size, the
following loop never ends:
while (max < 1024)
max += max;
Thus set ast->sample_size to 0 if it would otherwise be negative.
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ca234639ac)
Conflicts:
libavformat/avidec.c
This commit is contained in:
committed by
Michael Niedermayer
parent
35eabb85b2
commit
4d27d864a6
@@ -571,6 +571,7 @@ static int avi_read_header(AVFormatContext *s)
|
||||
default:
|
||||
av_log(s, AV_LOG_INFO, "unknown stream type %X\n", tag1);
|
||||
}
|
||||
ast->sample_size = FFMAX(ast->sample_size, 0);
|
||||
if(ast->sample_size == 0) {
|
||||
st->duration = st->nb_frames;
|
||||
if (st->duration > 0 && avi->io_fsize > 0 && avi->riff_end > avi->io_fsize) {
|
||||
|
||||
Reference in New Issue
Block a user