From 15dd56c093be480e719d7bbc39f8dbddb586694d Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 19 Aug 2016 23:54:28 +0200 Subject: [PATCH] avcodec/h2645_parse: fix nal size Found-by: Signed-off-by: Michael Niedermayer --- libavcodec/h2645_parse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c index 00594371c0..c3961a5e90 100644 --- a/libavcodec/h2645_parse.c +++ b/libavcodec/h2645_parse.c @@ -88,7 +88,8 @@ int ff_h2645_extract_rbsp(const uint8_t *src, int length, nal->size = nal->raw_size = length; return length; - } + } else if (i > length) + i = length; av_fast_padded_malloc(&nal->rbsp_buffer, &nal->rbsp_buffer_size, length + padding);