mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
avcodec/hevc_ps: Check log2_sao_offset_scale_*
Fixes: 4868/clusterfuzz-testcase-minimized-6236542906400768
Fixes: runtime error: shift exponent 126 is too large for 32-bit type 'int'
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4a75a75c62
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
b40576a9a4
commit
4abdd65356
@ -1266,6 +1266,11 @@ static int pps_range_extensions(GetBitContext *gb, AVCodecContext *avctx,
|
||||
pps->log2_sao_offset_scale_luma = get_ue_golomb_long(gb);
|
||||
pps->log2_sao_offset_scale_chroma = get_ue_golomb_long(gb);
|
||||
|
||||
if ( pps->log2_sao_offset_scale_luma > FFMAX(sps->bit_depth - 10, 0)
|
||||
|| pps->log2_sao_offset_scale_chroma > FFMAX(sps->bit_depth_chroma - 10, 0)
|
||||
)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user