aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/hevcdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-06-20 14:32:50 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-06-21 02:25:23 +0200
commitfdfbcbdd148765ba0fa5093d7feb944685a3e8c2 (patch)
tree6daefac9b91d5534933fe66624085952d5a9582d /libavcodec/hevcdec.c
parent5443c4bdf4828ac5b7b19cf54feb496c2da40079 (diff)
downloadffmpeg-fdfbcbdd148765ba0fa5093d7feb944685a3e8c2.tar.gz
avcodec/hevcdec: Check beta and tc offset in hls_slice_header()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/hevcdec.c')
-rw-r--r--libavcodec/hevcdec.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 3dc3669d67..0c478029c9 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -726,8 +726,17 @@ static int hls_slice_header(HEVCContext *s)
if (deblocking_filter_override_flag) {
sh->disable_deblocking_filter_flag = get_bits1(gb);
if (!sh->disable_deblocking_filter_flag) {
- sh->beta_offset = get_se_golomb(gb) * 2;
- sh->tc_offset = get_se_golomb(gb) * 2;
+ int beta_offset_div2 = get_se_golomb(gb);
+ int tc_offset_div2 = get_se_golomb(gb) ;
+ if (beta_offset_div2 < -6 || beta_offset_div2 > 6 ||
+ tc_offset_div2 < -6 || tc_offset_div2 > 6) {
+ av_log(s->avctx, AV_LOG_ERROR,
+ "Invalid deblock filter offsets: %d, %d\n",
+ beta_offset_div2, tc_offset_div2);
+ return AVERROR_INVALIDDATA;
+ }
+ sh->beta_offset = beta_offset_div2 * 2;
+ sh->tc_offset = tc_offset_div2 * 2;
}
} else {
sh->disable_deblocking_filter_flag = s->ps.pps->disable_dbf;