aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-12-10 01:41:44 +0000
committerMichael Niedermayer <michaelni@gmx.at>2015-02-12 17:10:35 +0100
commit0bdc64e8b9c1010c7756874ba913108a5f27addc (patch)
treeec314cb5c761581393b519e466bede00eeb1955e
parent5fbf63ea394e6a3ab2abf34628721cfa53e81182 (diff)
downloadffmpeg-0bdc64e8b9c1010c7756874ba913108a5f27addc.tar.gz
hevc: always clip luma_log2_weight_denom
Its value shall be between 0 and 7 according to the specifications. Bug-Id: CID 1257502
-rw-r--r--libavcodec/hevc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index fd557f4c2f..8fac87d889 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -144,7 +144,7 @@ static void pred_weight_table(HEVCContext *s, GetBitContext *gb)
uint8_t luma_weight_l1_flag[16];
uint8_t chroma_weight_l1_flag[16];
- s->sh.luma_log2_weight_denom = get_ue_golomb_long(gb);
+ s->sh.luma_log2_weight_denom = av_clip_c(get_ue_golomb_long(gb), 0, 7);
if (s->sps->chroma_format_idc != 0) {
int delta = get_se_golomb(gb);
s->sh.chroma_log2_weight_denom = av_clip(s->sh.luma_log2_weight_denom + delta, 0, 7);