diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2015-07-10 19:41:43 +0200 |
---|---|---|
committer | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2015-07-10 21:28:56 +0200 |
commit | 05cc8c8e4b7008ff3be8ec477c901b2ceca4b16b (patch) | |
tree | 90e824ca662eb56929fd1780d2d5f65a2d08be4d /libavcodec/hevc.c | |
parent | 72527d9c54a95454153e971d11f114f2a4f19073 (diff) | |
download | ffmpeg-05cc8c8e4b7008ff3be8ec477c901b2ceca4b16b.tar.gz |
hevc: check slice address length
It is used as get_bits argument and reading 0 bits isn't supported.
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r-- | libavcodec/hevc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index 38734f017d..6ff52ec7fa 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -459,7 +459,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", |