The branch, master has been updated
       via  f07c12d806b9a6f3ca05870a99d10a818a3aabc1 (commit)
      from  9dc79241d9680fc050376bb0cc37875a41d00cc9 (commit)


- Log -----------------------------------------------------------------
commit f07c12d806b9a6f3ca05870a99d10a818a3aabc1
Author:     Niklas Haas <[email protected]>
AuthorDate: Mon Sep 1 16:39:00 2025 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Mon Sep 1 15:33:43 2025 +0000

    avfilter/x86/vf_colordetect: fix alpha detect tail handling
    
    This wrapping logic still considered any nonzero return from the ASM 
function
    to be the overall result, but this is not true since the addition of
    FF_ALPHA_TRANSPARENT.
    
    Fix it by only early returning if FF_ALPHA_STRAIGHT is detected.
    
    Fixes: 9b8b78a8153f9ca94b7eb9cba87442954787912a
    See-Also: 
https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20301#issuecomment-4802

diff --git a/libavfilter/x86/vf_colordetect_init.c 
b/libavfilter/x86/vf_colordetect_init.c
index 828f01937d..72fa021bf2 100644
--- a/libavfilter/x86/vf_colordetect_init.c
+++ b/libavfilter/x86/vf_colordetect_init.c
@@ -31,11 +31,11 @@ static int FUNC_NAME(const uint8_t *src, ptrdiff_t stride,
 {                                                                              
 \
     ptrdiff_t bytes = (width << SHIFT) & ~(MMSIZE - 1);                        
 \
     int ret = ASM_FUNC_NAME(src, stride, bytes, height, min, max);             
 \
-    if (ret)                                                                   
 \
+    if (ret == FF_ALPHA_STRAIGHT)                                              
 \
         return ret;                                                            
 \
                                                                                
 \
-    return C_FUNC_NAME(src + bytes, stride, width - (bytes >> SHIFT),          
 \
-                       height, min, max);                                      
 \
+    return ret | C_FUNC_NAME(src + bytes, stride, width - (bytes >> SHIFT),    
 \
+                             height, min, max);                                
 \
 }
 
 #define DETECT_ALPHA_FUNC(FUNC_NAME, ASM_FUNC_NAME, C_FUNC_NAME, SHIFT, 
MMSIZE) \
@@ -50,11 +50,12 @@ static int FUNC_NAME(const uint8_t *color, ptrdiff_t 
color_stride,
     ptrdiff_t bytes = (width << SHIFT) & ~(MMSIZE - 1);                        
 \
     int ret = ASM_FUNC_NAME(color, color_stride, alpha, alpha_stride,          
 \
                             bytes, height, p, q, k);                           
 \
-    if (ret)                                                                   
 \
+    if (ret == FF_ALPHA_STRAIGHT)                                              
 \
         return ret;                                                            
 \
                                                                                
 \
-    return C_FUNC_NAME(color + bytes, color_stride, alpha + bytes, 
alpha_stride,\
-                       width - (bytes >> SHIFT), height, p, q, k);             
 \
+    return ret | C_FUNC_NAME(color + bytes, color_stride, alpha + bytes,       
 \
+                             alpha_stride, width - (bytes >> SHIFT), height,   
 \
+                             p, q, k);                                         
 \
 }
 
 #if HAVE_X86ASM

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

Summary of changes:
 libavfilter/x86/vf_colordetect_init.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)


hooks/post-receive
-- 

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to