X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fhevc_parser.c;h=4625e6149af7f2f0ecf02ecc7b055bde63c9167b;hb=9de85c544aaa0e38f52154e6a6b3a1adc02993c8;hp=fc107978c69632331e296968c4ce3fdbde11d1be;hpb=8a04ddeb4704e1f3c7237d48d95edae08a3193fe;p=ffmpeg diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c index fc107978c69..4625e6149af 100644 --- a/libavcodec/hevc_parser.c +++ b/libavcodec/hevc_parser.c @@ -318,7 +318,7 @@ static inline int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf, slice_address_length = av_ceil_log2_c(ps->sps->ctb_width * ps->sps->ctb_height); - sh->slice_segment_addr = slice_address_length ? get_bits(gb, slice_address_length) : 0; + sh->slice_segment_addr = get_bitsz(gb, slice_address_length); if (sh->slice_segment_addr >= ps->sps->ctb_width * ps->sps->ctb_height) { av_log(avctx, AV_LOG_ERROR, "Invalid slice segment address: %u.\n", sh->slice_segment_addr);