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

Git pushed a commit to branch master
in repository ffmpeg.

commit 1ecf42935734174a289eb5b2ea37542f3403f83f
Author:     Zhao Zhili <[email protected]>
AuthorDate: Mon Sep 14 23:00:21 2026 +0800
Commit:     Zhao Zhili <[email protected]>
CommitDate: Thu Sep 17 02:47:35 2026 +0000

    avutil/hwcontext_videotoolbox: document mapping string ownership
    
    The color mapping functions return CFStringRefs borrowed from CoreVideo,
    but the header did not say so. Callers that assumed Create semantics and
    released the result freed CoreVideo's internal codepoint cache entries,
    crashing later users of the same value.
    
    Also return NULL, not 0, in the docs when no equivalent is found.
---
 libavutil/hwcontext_videotoolbox.h | 29 +++++++++++++++++++++++++----
 1 file changed, 25 insertions(+), 4 deletions(-)

diff --git a/libavutil/hwcontext_videotoolbox.h 
b/libavutil/hwcontext_videotoolbox.h
index d35cfbb6c1..b12880b159 100644
--- a/libavutil/hwcontext_videotoolbox.h
+++ b/libavutil/hwcontext_videotoolbox.h
@@ -66,26 +66,47 @@ uint32_t av_map_videotoolbox_format_from_pixfmt2(enum 
AVPixelFormat pix_fmt, boo
 
 /**
  * Convert an AVChromaLocation to a VideoToolbox/CoreVideo chroma location 
string.
- * Returns 0 if no known equivalent was found.
+ *
+ * The returned string is a CoreVideo constant and must not be released.
+ *
+ * Returns NULL if no known equivalent was found.
  */
 CFStringRef av_map_videotoolbox_chroma_loc_from_av(enum AVChromaLocation loc);
 
 /**
  * Convert an AVColorSpace to a VideoToolbox/CoreVideo color matrix string.
- * Returns 0 if no known equivalent was found.
+ *
+ * The returned string is borrowed from CoreVideo and must not be released.
+ * It is either a constant, or an entry of CoreVideo's internal codepoint
+ * cache; releasing a cached entry makes later lookups of the same value
+ * return a dangling pointer.
+ *
+ * Returns NULL if no known equivalent was found.
  */
 CFStringRef av_map_videotoolbox_color_matrix_from_av(enum AVColorSpace space);
 
 /**
  * Convert an AVColorPrimaries to a VideoToolbox/CoreVideo color primaries 
string.
- * Returns 0 if no known equivalent was found.
+ *
+ * The returned string is borrowed from CoreVideo and must not be released.
+ * It is either a constant, or an entry of CoreVideo's internal codepoint
+ * cache; releasing a cached entry makes later lookups of the same value
+ * return a dangling pointer.
+ *
+ * Returns NULL if no known equivalent was found.
  */
 CFStringRef av_map_videotoolbox_color_primaries_from_av(enum AVColorPrimaries 
pri);
 
 /**
  * Convert an AVColorTransferCharacteristic to a VideoToolbox/CoreVideo color 
transfer
  * function string.
- * Returns 0 if no known equivalent was found.
+ *
+ * The returned string is borrowed from CoreVideo and must not be released.
+ * It is either a constant, or an entry of CoreVideo's internal codepoint
+ * cache; releasing a cached entry makes later lookups of the same value
+ * return a dangling pointer.
+ *
+ * Returns NULL if no known equivalent was found.
  */
 CFStringRef av_map_videotoolbox_color_trc_from_av(enum 
AVColorTransferCharacteristic trc);
 

-- 
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