avcodec/h264: more completely check the loop filter parameters

Fixes out of array read
Fixes: caa65cc01655505705129b677189f036-signal_sigsegv_fdcc43_2681_cov_3043376737_PPH422I5_Panasonic_A.264
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-02-17 00:24:20 +01:00
parent c919e1ca2e
commit 91253839e1
1 changed files with 2 additions and 2 deletions

View File

@ -4014,8 +4014,8 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
if (h->deblocking_filter) {
h->slice_alpha_c0_offset += get_se_golomb(&h->gb) << 1;
h->slice_beta_offset += get_se_golomb(&h->gb) << 1;
if (h->slice_alpha_c0_offset > 104U ||
h->slice_beta_offset > 104U) {
if (h->slice_alpha_c0_offset < 52 - 12 || h->slice_alpha_c0_offset > 52 + 12 ||
h->slice_beta_offset < 52 - 12 || h->slice_beta_offset > 52 + 12) {
av_log(h->avctx, AV_LOG_ERROR,
"deblocking filter parameters %d %d out of range\n",
h->slice_alpha_c0_offset, h->slice_beta_offset);