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);