summaryrefslogtreecommitdiff
path: root/libavcodec/hevc.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-07-10 19:41:43 +0200
committerAnton Khirnov <anton@khirnov.net>2015-07-12 18:15:39 +0200
commit9f4c7397a296e6d11b3c6c121a6896163577dc7c (patch)
treecba094ed7d04ac745f7392b1a37ed74b90c5dfb4 /libavcodec/hevc.c
parenta9a2f3613040c4f90bf15cbd76f8671252ecc043 (diff)
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>
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r--libavcodec/hevc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index ce4533e639..88198fca8c 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -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",