Skip to content

Commit 4018b91

Browse files
committed
avcodec/vvc/refs: fix negative pps_scaling_win offsets
The spec seems to allow these to be negative Fixes: left shift of negative value -15 Fixes: 392687035/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-6559804532785152 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Frank Plowman <post@frankplowman.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 33679f5) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
1 parent 6c4e56f commit 4018b91

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libavcodec/vvc/refs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ static VVCFrame *alloc_frame(VVCContext *s, VVCFrameContext *fc)
146146
for (int j = 0; j < frame->ctb_count; j++)
147147
frame->rpl_tab[j] = frame->rpl;
148148

149-
win->left_offset = pps->r->pps_scaling_win_left_offset << sps->hshift[CHROMA];
150-
win->right_offset = pps->r->pps_scaling_win_right_offset << sps->hshift[CHROMA];
151-
win->top_offset = pps->r->pps_scaling_win_top_offset << sps->vshift[CHROMA];
152-
win->bottom_offset = pps->r->pps_scaling_win_bottom_offset << sps->vshift[CHROMA];
149+
win->left_offset = pps->r->pps_scaling_win_left_offset * (1 << sps->hshift[CHROMA]);
150+
win->right_offset = pps->r->pps_scaling_win_right_offset * (1 << sps->hshift[CHROMA]);
151+
win->top_offset = pps->r->pps_scaling_win_top_offset * (1 << sps->vshift[CHROMA]);
152+
win->bottom_offset = pps->r->pps_scaling_win_bottom_offset * (1 << sps->vshift[CHROMA]);
153153
frame->ref_width = pps->r->pps_pic_width_in_luma_samples - win->left_offset - win->right_offset;
154154
frame->ref_height = pps->r->pps_pic_height_in_luma_samples - win->bottom_offset - win->top_offset;
155155

0 commit comments

Comments
 (0)