Browse Source

hevc: check slice address length

It is used as get_bits argument and reading 0 bits doesn't make sense.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
tags/n2.8
Andreas Cadhalpun Anton Khirnov 10 years ago
parent
commit
9f4c7397a2
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/hevc.c

+ 1
- 1
libavcodec/hevc.c View File

@@ -532,7 +532,7 @@ static int hls_slice_header(HEVCContext *s)

slice_address_length = av_ceil_log2(s->sps->ctb_width *
s->sps->ctb_height);
sh->slice_segment_addr = get_bits(gb, slice_address_length);
sh->slice_segment_addr = slice_address_length ? get_bits(gb, slice_address_length) : 0;
if (sh->slice_segment_addr >= s->sps->ctb_width * s->sps->ctb_height) {
av_log(s->avctx, AV_LOG_ERROR,
"Invalid slice segment address: %u.\n",


Loading…
Cancel
Save