diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-10 21:32:05 +0100 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2014-01-21 11:57:43 +0100 |
commit | d5c15ebeaf1914ea5e3e0599d4316d7c4cf74434 (patch) | |
tree | 9bcc7137c1cc71b0e6819b5bbed0607de9457eaa /libavcodec/hevc_filter.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_filter.c')
-rw-r--r-- | libavcodec/hevc_filter.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c index bb1e360dd4..f3c655416a 100644 --- a/libavcodec/hevc_filter.c +++ b/libavcodec/hevc_filter.c @@ -158,8 +158,8 @@ void ff_hevc_set_qPy(HEVCContext *s, int xC, int yC, if (s->HEVClc.tu.cu_qp_delta != 0) { int off = s->sps->qp_bd_offset; - s->HEVClc.qp_y = ((qp_y + s->HEVClc.tu.cu_qp_delta + 52 + 2 * off) % - (52 + off)) - off; + s->HEVClc.qp_y = FFUMOD(qp_y + s->HEVClc.tu.cu_qp_delta + 52 + 2 * off, + 52 + off) - off; } else s->HEVClc.qp_y = qp_y; } |