From c09820d25c59950940a91c4c0e8c7e71121f44bc Mon Sep 17 00:00:00 2001 From: WyattBlue Date: Wed, 21 Jan 2026 03:31:57 -0500 Subject: [PATCH] Fix sws_scale const correctness for strict GCC --- av/video/reformatter.pyx | 6 +++--- include/libswscale/swscale.pxd | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/av/video/reformatter.pyx b/av/video/reformatter.pyx index 4f6ec4c9f..465df6278 100644 --- a/av/video/reformatter.pyx +++ b/av/video/reformatter.pyx @@ -157,8 +157,8 @@ cdef class VideoReformatter: # We want to change the colorspace/color_range transforms. # We do that by grabbing all of the current settings, changing a # couple, and setting them all. We need a lot of state here. - cdef const int *inv_tbl - cdef const int *tbl + cdef int *inv_tbl + cdef int *tbl cdef int src_colorspace_range, dst_colorspace_range cdef int brightness, contrast, saturation cdef int ret @@ -209,7 +209,7 @@ cdef class VideoReformatter: with nogil: lib.sws_scale( self.ptr, - frame.ptr.data, + frame.ptr.data, frame.ptr.linesize, 0, # slice Y frame.ptr.height, diff --git a/include/libswscale/swscale.pxd b/include/libswscale/swscale.pxd index af7f7d134..a9698ecb3 100644 --- a/include/libswscale/swscale.pxd +++ b/include/libswscale/swscale.pxd @@ -49,11 +49,11 @@ cdef extern from "libswscale/swscale.h" nogil: cdef int sws_scale( SwsContext *ctx, - unsigned char **src_slice, - int *src_stride, + const unsigned char *const *src_slice, + const int *src_stride, int src_slice_y, int src_slice_h, - unsigned char **dst_slice, + unsigned char *const *dst_slice, int *dst_stride, )