In vtenc_populate_extradata, the cleanup function vtenc_reset should not
be used when no error occurs, otherwise some color information is lost
(#11036).
This patch checks the status code and conducts the correct cleanup.
Signed-off-by: Hao Guan
---
libavcodec/videotoolboxenc.c | 9
Signed-off-by: Hao Guan
---
Notes:
I have checked out the code about other functions introduced after macOS
10.13 and noticed that the availability is checked during configure. Therefore
I add the check for sRGB function too. It should compile now.
configure| 2
---
libavcodec/videotoolboxenc.c | 4
1 file changed, 4 insertions(+)
diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index 4eaabed5d8..61eb6e1921 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -990,6 +990,10 @@ static int get_cv_tran