This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 38ac3a9237d1175e1461e6aee2dee24be1710a55
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Thu Oct 15 15:51:52 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Mon Oct 19 23:51:00 2026 +0000

    avfilter/vf_codecview: compute the arrow head length in 64bit
    
    Fixes: division by zero
    Fixes: signed integer overflow
    Fixes: NaN to int conversion
    Fixes: 2qHh10XPbgiO
    Fixes: swarm-Signed-integer-overflow-in-draw_arrow-length-calc-8f1f15
    Division by zero Replicated through UnModified FFmpeg with ASAN
    Signed integer overflow Replicated through UnModified FFmpeg with UBSAN
    NaN to int conversion Replicated through UnModified FFmpeg with UBSAN
    
    Found-by: zhang xingxing <[email protected]>
    The report suggested doing the shift in a wider unsigned type.
    
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavfilter/vf_codecview.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_codecview.c b/libavfilter/vf_codecview.c
index f20056b91b..cd445e4e9c 100644
--- a/libavfilter/vf_codecview.c
+++ b/libavfilter/vf_codecview.c
@@ -190,7 +190,7 @@ static void draw_arrow(uint8_t *buf, int sx, int sy, int ex,
     if (dx * dx + dy * dy > 3 * 3) {
         int rx =  dx + dy;
         int ry = -dx + dy;
-        int length = sqrt((rx * rx + ry * ry) << 8);
+        int length = sqrt((rx * (int64_t)rx + ry * (int64_t)ry) << 8);
 
         // FIXME subpixel accuracy
         rx = ROUNDED_DIV(rx * (3 << 4), length);

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to