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

Git pushed a commit to branch master
in repository ffmpeg.

commit 7637009f0276c47b4a101cf0ef12458dfea0d9b3
Author:     Andreas Rheinhardt <[email protected]>
AuthorDate: Fri Aug 7 17:58:21 2026 +0200
Commit:     Andreas Rheinhardt <[email protected]>
CommitDate: Sun Aug 9 17:28:59 2026 +0200

    avcodec/x86/diracdsp_init: Avoid cast
    
    put_signed_rect_clamped uses different types for differnt
    8bit and >8bit content. The 8bit SSE2 function used the real
    type in its function signature; this does not coincide with
    the array of function pointers it gets put into and therefore
    also not with how it is called which is UB. Also, casts of
    function pointers to void* like it is done here are not
    legal ISO-C as function pointers and object pointers need not
    be convertible.
    
    So just declare the function to have the required type for
    the function pointer array.
    
    Reviewed-by: Lynne <[email protected]>
    Signed-off-by: Andreas Rheinhardt <[email protected]>
---
 libavcodec/x86/diracdsp.asm    | 3 ++-
 libavcodec/x86/diracdsp_init.c | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavcodec/x86/diracdsp.asm b/libavcodec/x86/diracdsp.asm
index 9a6e1d4354..43a3039476 100644
--- a/libavcodec/x86/diracdsp.asm
+++ b/libavcodec/x86/diracdsp.asm
@@ -131,8 +131,9 @@ cglobal dirac_hpel_filter_h, 3,3,7, dst, src, width
     RET
 
 ; void ff_put_signed_rect_clamped_sse2(uint8_t *dst, ptrdiff_t dst_stride,
-;                                      const int16_t *src, ptrdiff_t 
src_stride,
+;                                      const uint8_t *src, ptrdiff_t 
src_stride,
 ;                                      int width, int height)
+; note: src actually points to int16_t
 cglobal put_signed_rect_clamped, 5,9,3, dst, dst_stride, src, src_stride, w, 
dst2, src2
     mova    m0, [pb_80]
     add     wd, (mmsize-1)
diff --git a/libavcodec/x86/diracdsp_init.c b/libavcodec/x86/diracdsp_init.c
index 031a4b659d..95fdcb02dc 100644
--- a/libavcodec/x86/diracdsp_init.c
+++ b/libavcodec/x86/diracdsp_init.c
@@ -35,7 +35,7 @@ void ff_add_dirac_obmc32_sse2(uint16_t *dst, const uint8_t 
*src, ptrdiff_t strid
 
 void ff_put_rect_clamped_sse2(uint8_t *dst, ptrdiff_t dst_stride, const 
int16_t *src,
                               ptrdiff_t src_stride, int width, int height);
-void ff_put_signed_rect_clamped_sse2(uint8_t *dst, ptrdiff_t dst_stride, const 
int16_t *src,
+void ff_put_signed_rect_clamped_sse2(uint8_t *dst, ptrdiff_t dst_stride, const 
uint8_t *src,
                                      ptrdiff_t src_stride, int width, int 
height);
 void ff_put_signed_rect_clamped_10_sse4(uint8_t *dst, ptrdiff_t dst_stride, 
const uint8_t *src,
                                         ptrdiff_t src_stride, int width, int 
height);
@@ -95,7 +95,7 @@ void ff_diracdsp_init_x86(DiracDSPContext* c)
     if (EXTERNAL_SSE2(mm_flags)) {
         c->dirac_hpel_filter = dirac_hpel_filter_sse2;
         c->add_rect_clamped = ff_add_rect_clamped_sse2;
-        c->put_signed_rect_clamped[0] = (void 
*)ff_put_signed_rect_clamped_sse2;
+        c->put_signed_rect_clamped[0] = ff_put_signed_rect_clamped_sse2;
 
         c->add_dirac_obmc[0] = ff_add_dirac_obmc8_sse2;
         c->add_dirac_obmc[1] = ff_add_dirac_obmc16_sse2;

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

Reply via email to