[FFmpeg-cvslog] [ffmpeg] branch master updated. 134fbfd1dc avcodec/sanm: Check w, h, left, top

ffmpeg-git at ffmpeg.org ffmpeg-git at ffmpeg.org
Sun Aug 17 19:46:39 EEST 2025


The branch, master has been updated
       via  134fbfd1dcb59441e38d870ddd231772f4e8e127 (commit)
      from  a2cfaf1b916cd4519249031adc37e339baca7a7b (commit)


- Log -----------------------------------------------------------------
commit 134fbfd1dcb59441e38d870ddd231772f4e8e127
Author:     Michael Niedermayer <michael at niedermayer.cc>
AuthorDate: Sun Aug 17 15:31:48 2025 +0200
Commit:     Michael Niedermayer <michael at niedermayer.cc>
CommitDate: Sun Aug 17 15:39:33 2025 +0200

    avcodec/sanm: Check w,h,left,top
    
    The setup code fow w,h,left,top is complex, the code using it also falls in
    at least 2 different classes, one using left/top the other not.
    
    To ensure no out of array access happens we add this clear check.
    
    Fixes: out of array access
    Fixes: 439261995/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SANM_fuzzer-5383455572819968
    
    Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
    Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c
index a066a864eb..9e99aa9dd9 100644
--- a/libavcodec/sanm.c
+++ b/libavcodec/sanm.c
@@ -1757,6 +1757,11 @@ static int process_frame_obj(SANMVideoContext *ctx, GetByteContext *gb)
             memset(ctx->fbuf, 0, ctx->frm0_size);
     }
 
+    if (w + FFMAX(left, 0) > ctx->avctx->width || h + FFMAX(top, 0) > ctx->avctx->height) {
+        avpriv_request_sample(ctx->avctx, "overly large frame\n");
+        return AVERROR_PATCHWELCOME;
+    }
+
     switch (codec) {
     case 1:
     case 3:

-----------------------------------------------------------------------

Summary of changes:
 libavcodec/sanm.c | 5 +++++
 1 file changed, 5 insertions(+)


hooks/post-receive
-- 



More information about the ffmpeg-cvslog mailing list