aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-10-14 12:40:38 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-10-15 01:19:45 +0200
commitc27c7b49dc00a955779ad4b6801a993da5a962de (patch)
treebb8384fd8f2c988a6520a4b19e2d57ed3207b166
parentf099946fafb8f4b1beb40b680599ccce96263ccd (diff)
downloadffmpeg-c27c7b49dc00a955779ad4b6801a993da5a962de.tar.gz
avcodec/av1_parse: Check obu_size
Fixes: out of array read Fixes: SIGSEGV_get_obu_bit_length_av1_parse Found-by: keval shah <skeval65@gmail.com> Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/av1_parse.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/av1_parse.h b/libavcodec/av1_parse.h
index 276af33ba9..864308f81d 100644
--- a/libavcodec/av1_parse.h
+++ b/libavcodec/av1_parse.h
@@ -134,8 +134,8 @@ static inline int parse_obu_header(const uint8_t *buf, int buf_size,
size = *obu_size + *start_pos;
- if (size > INT_MAX)
- return AVERROR(ERANGE);
+ if (size > buf_size)
+ return AVERROR_INVALIDDATA;
return size;
}