avcodec/utils: Ensure linesize for SVQ3

Fixes: Assertion block_w * sizeof(uint8_t) <= ((buf_linesize) >= 0 ? (buf_linesize) : (-(buf_linesize))
Fixes: 54861/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SVQ3_fuzzer-5352418248622080

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 4eef658ca5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2023-01-11 19:39:38 +01:00
parent ca1b6608f5
commit fd6043ac28
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 3 additions and 0 deletions

View File

@ -339,6 +339,9 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
// the next rounded up width is 32
*width = FFMAX(*width, 32);
}
if (s->codec_id == AV_CODEC_ID_SVQ3) {
*width = FFMAX(*width, 32);
}
for (i = 0; i < 4; i++)
linesize_align[i] = STRIDE_ALIGN;