From 86e3289ffdec88f771ce8ec039ef5b90eb70b4cd Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 25 Mar 2012 04:15:51 +0200 Subject: [PATCH] mov: fix heap buffer overflow Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- libavformat/mov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 785d284b86..0e9566fe3a 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1830,7 +1830,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st) current_dts -= sc->dts_shift; - if (!sc->sample_count) + if (!sc->sample_count || st->nb_index_entries) return; if (sc->sample_count >= UINT_MAX / sizeof(*st->index_entries)) return;