aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-07-31 21:43:39 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-08-01 00:18:02 +0200
commit06f5ed40f8fceb2542add052c57608121eda2f41 (patch)
tree89bf1e8629e1a1cb955512eed60c3adc0fe31ca2
parent58fbeb59e74ac9a4ca81e9bc44141abcbff8ab6d (diff)
downloadffmpeg-06f5ed40f8fceb2542add052c57608121eda2f41.tar.gz
avcodec/snow: Fix off by 1 error in run_buffer
Fixes: out of array access Fixes: 70741/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-5703668010647552 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/snow.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index 0285362d43..af6214d077 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -428,7 +428,7 @@ av_cold int ff_snow_common_init(AVCodecContext *avctx){
!FF_ALLOCZ_TYPED_ARRAY(s->spatial_dwt_buffer, width * height) || //FIXME this does not belong here
!FF_ALLOCZ_TYPED_ARRAY(s->temp_dwt_buffer, width) ||
!FF_ALLOCZ_TYPED_ARRAY(s->temp_idwt_buffer, width) ||
- !FF_ALLOCZ_TYPED_ARRAY(s->run_buffer, ((width + 1) >> 1) * ((height + 1) >> 1)))
+ !FF_ALLOCZ_TYPED_ARRAY(s->run_buffer, ((width + 1) >> 1) * ((height + 1) >> 1) + 1))
return AVERROR(ENOMEM);
for(i=0; i<MAX_REF_FRAMES; i++) {