summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-01-11 19:39:38 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2023-04-21 01:55:15 +0200
commit94687a5eff3daee51d64ee5e6a143cded942076a (patch)
tree7483cbd2fbc41a5fff5db199ea82f68412cf4e40
parent0c3028513256ce3165873958a949204cda99794b (diff)
downloadffmpeg-94687a5eff3daee51d64ee5e6a143cded942076a.tar.gz
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 4eef658ca59d3d6ba46ab52a36d7faf5fe820874) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 62d51f4641..12951cbcd5 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -343,6 +343,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;