[PR] avfilter/boxblur: reject pixel formats deeper than 16 bits (PR #23658)

michaelni via ffmpeg-devel <[email protected]>
Newsgroups gmane.comp.video.ffmpeg.devel
Message-ID <178284145674.59.11932415134595118214@29965ddac10e>
PR #23658 opened by michaelni
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23658
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23658.patch

Fixes: heap buffer overflow
Fixes: CRufFb6TVikL
Fixes: dee7440531 (vf_boxblur: Templatize blur{8,16})
Found-by: Pavel Kohout (Aisle Research)
Signed-off-by: Michael Niedermayer <[email protected]>



>From 530ed8f5b377c395ec6b0cbc393bd9574465689b Mon Sep 17 00:00:00 2001
From: Pavel Kohout <[email protected]>
Date: Mon, 29 Jun 2026 23:37:16 +0200
Subject: [PATCH] avfilter/boxblur: reject pixel formats deeper than 16 bits

Fixes: heap buffer overflow
Fixes: CRufFb6TVikL
Fixes: dee7440531 (vf_boxblur: Templatize blur{8,16})
Found-by: Pavel Kohout (Aisle Research)
Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavfilter/vf_boxblur.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavfilter/vf_boxblur.c b/libavfilter/vf_boxblur.c
index 3cb42471a7..bd5166095f 100644
--- a/libavfilter/vf_boxblur.c
+++ b/libavfilter/vf_boxblur.c
@@ -66,6 +66,7 @@ static int query_formats(const AVFilterContext *ctx,
         const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt);
         if (!(desc->flags & (AV_PIX_FMT_FLAG_HWACCEL | AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_PAL)) &&
             (desc->flags & AV_PIX_FMT_FLAG_PLANAR || desc->nb_components == 1) &&
+            !(desc->flags & AV_PIX_FMT_FLAG_FLOAT) && desc->comp[0].depth <= 16 &&
             (!(desc->flags & AV_PIX_FMT_FLAG_BE) == !HAVE_BIGENDIAN || desc->comp[0].depth == 8) &&
             (ret = ff_add_format(&formats, fmt)) < 0)
             return ret;
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.