From cc13bc8c4f0f4afa30d0b94c3f3a369ccd2aaf0b Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 18 Aug 2016 20:41:31 +0200 Subject: avcodec/h2645: Fix NAL unit padding The parser changes have lost the support for the needed padding, this adds it back Fixes out of array reads Fixes: 03ea21d271abc8acf428d42ace51d8b4/asan_heap-oob_3358eef_5692_16f0cc01ab5225e9ce591659e5c20e35.mkv Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- libavcodec/hevc_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavcodec/hevc_parser.c') diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c index b5633f16ef..d93586ba7d 100644 --- a/libavcodec/hevc_parser.c +++ b/libavcodec/hevc_parser.c @@ -90,7 +90,7 @@ static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf, int ret, i; ret = ff_h2645_packet_split(&ctx->pkt, buf, buf_size, avctx, 0, 0, - AV_CODEC_ID_HEVC); + AV_CODEC_ID_HEVC, 1); if (ret < 0) return ret; @@ -243,7 +243,7 @@ static inline int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf, src_length = 20; } - consumed = ff_h2645_extract_rbsp(buf, src_length, nal); + consumed = ff_h2645_extract_rbsp(buf, src_length, nal, 1); if (consumed < 0) return consumed; -- cgit v1.2.3