This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 35c1620e7c8d57d837aa881a89c394ff4921e016 Author: Niklas Haas <[email protected]> AuthorDate: Tue Nov 3 17:32:49 2026 +0100 Commit: Niklas Haas <[email protected]> CommitDate: Sun Nov 8 01:48:12 2026 +0000 swscale/internal: add ff_refstruct_calloc() helper Useful for building op private data, which tends to be needed for large structures like filter kernels. Avoids the theoretical risk of overflow from such allocations. Signed-off-by: Niklas Haas <[email protected]> --- libswscale/swscale_internal.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index ba069ccd89..cb13f9a734 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -37,6 +37,7 @@ #include "libavutil/mem_internal.h" #include "libavutil/pixfmt.h" #include "libavutil/pixdesc.h" +#include "libavutil/refstruct.h" #include "libavutil/slicethread.h" #include "libavutil/half2float.h" @@ -74,6 +75,13 @@ #define RETCODE_USE_CASCADE -12345 +static inline void *ff_refstruct_calloc(size_t n, size_t size) +{ + if (size && n > SIZE_MAX / size) + return NULL; + return av_refstruct_allocz(n * size); +} + typedef struct SwsInternal SwsInternal; static inline SwsInternal *sws_internal(const SwsContext *sws) -- 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]
