aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-10-24 02:29:50 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-10-24 12:58:09 +0200
commit210afae0ba651a4f11468449989c6334bb856268 (patch)
tree2cf183ce650dee21ec76399f13e0d26fa1767700
parente7811e48be26649c05a813efc9d47ea42ac916ee (diff)
downloadffmpeg-210afae0ba651a4f11468449989c6334bb856268.tar.gz
avformat/utils: Check size argument in ff_add_index_entry()
Fixes infinite loop Fixes Ticket3061 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 1c036aac8d..ed307eec0b 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1627,6 +1627,9 @@ int ff_add_index_entry(AVIndexEntry **index_entries,
if(timestamp == AV_NOPTS_VALUE)
return AVERROR(EINVAL);
+ if (size < 0 || size > 0x3FFFFFFF)
+ return AVERROR(EINVAL);
+
if (is_relative(timestamp)) //FIXME this maintains previous behavior but we should shift by the correct offset once known
timestamp -= RELATIVE_TS_BASE;