[FFmpeg-cvslog] avcodec/snow: Fix off by 1 error in run_buffer
Michael Niedermayer
git at videolan.org
Mon Aug 5 02:22:24 EEST 2024
ffmpeg | branch: release/5.1 | Michael Niedermayer <michael at niedermayer.cc> | Wed Jul 31 21:43:39 2024 +0200| [8c689f4d0cfaedefed98841a6dabae67341cf98d] | committer: Michael Niedermayer
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 at niedermayer.cc>
(cherry picked from commit 06f5ed40f8fceb2542add052c57608121eda2f41)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8c689f4d0cfaedefed98841a6dabae67341cf98d
---
libavcodec/snow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index 293a0eb7d9..8a19578aad 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -492,7 +492,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++) {
More information about the ffmpeg-cvslog
mailing list