[FFmpeg-cvslog] hevc: always clip luma_log2_weight_denom
Vittorio Giovara
git at videolan.org
Mon Dec 15 21:19:19 CET 2014
ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Wed Dec 10 01:41:44 2014 +0000| [b2bece5e9a4dd96142962c6798e187c77b88bbfa] | committer: Vittorio Giovara
hevc: always clip luma_log2_weight_denom
Its value shall be between 0 and 7 according to the specifications.
CC: libav-stable at libav.org
Bug-Id: CID 1257502
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b2bece5e9a4dd96142962c6798e187c77b88bbfa
---
libavcodec/hevc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 08bed86..897a28e 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -251,7 +251,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_c(s->sh.luma_log2_weight_denom + delta, 0, 7);
More information about the ffmpeg-cvslog
mailing list