summaryrefslogtreecommitdiff
path: root/libavformat/avidec.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>2015-05-04 23:01:45 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-05 00:04:38 +0200
commitca234639ac49a0dc073ac1f10977979acdb94f97 (patch)
treeb88a0a832c0f210ef0cff94fb5f4bcff2563aff2 /libavformat/avidec.c
parent079b7f6eacc09bc2813fc1ddc230ab05022b69c2 (diff)
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>
Diffstat (limited to 'libavformat/avidec.c')
-rw-r--r--libavformat/avidec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 9d7c724f94..0668b17690 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -693,6 +693,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) {