diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-11 00:32:05 +0400 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2014-01-21 14:57:43 +0400 |
commit | d5c15ebeaf1914ea5e3e0599d4316d7c4cf74434 (patch) | |
tree | 9bcc7137c1cc71b0e6819b5bbed0607de9457eaa /libavcodec/hevc.c | |
parent | a7a07cc98ac548297b5b0628cb81280e11952e3f (diff) |
hevc: Fix modulo operations
Keep qp fields within the range.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r-- | libavcodec/hevc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index 438794ded7..d5175f52d2 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -771,8 +771,8 @@ static int hls_slice_header(HEVCContext *s) s->HEVClc.first_qp_group = !s->sh.dependent_slice_segment_flag; if (!s->pps->cu_qp_delta_enabled_flag) - s->HEVClc.qp_y = ((s->sh.slice_qp + 52 + 2 * s->sps->qp_bd_offset) % - (52 + s->sps->qp_bd_offset)) - s->sps->qp_bd_offset; + s->HEVClc.qp_y = FFUMOD(s->sh.slice_qp + 52 + 2 * s->sps->qp_bd_offset, + 52 + s->sps->qp_bd_offset) - s->sps->qp_bd_offset; s->slice_initialized = 1; |