[vlc-commits] [Git][videolan/vlc][master] 2 commits: caca: fix to newer version

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Fri Feb 11 13:15:00 UTC 2022



Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC


Commits:
2c7b5e00 by Alexandre Janniaux at 2022-02-11T12:21:35+00:00
caca: fix to newer version

Migrate to the new API instead of libcucul API, which has been merged
into libcaca since 0.99.beta15:

    commit f61816ceb7445f8bf818936151554ac060764b39
    Author: Sam Hocevar <sam at hocevar.net>
    Date:   Sat Sep 27 13:12:46 2008 +0000

    Starting refactoring to get rid of libcucul. The initial reason for the
    split is rendered moot by the plugin system: when enabled, binaries do
    not link directly with libX11 or libGL. I hope this is a step towards
    more consisteny and clarity.

It was then completely wiped out by the following commit, which is part
of v0.99.beta20:

    commit 5f0ec215f8c9915ed028324a8ecac8212f68e18d
    Author: Sam Hocevar <sam at hocevar.net>
    Date:   Thu May 3 10:33:30 2018 +0200

    Remove legacy code from 10 years ago.

- - - - -
2d597455 by Alexandre Janniaux at 2022-02-11T12:21:35+00:00
caca: update contrib to 0.99.beta20

The new contrib fixes a bunch of reported CVE:

    CVE-2021-30498  (tga export, not concerned)
    CVE-2021-30499  (troff export, not concerned)
    CVE-2021-3410   (canvas.c, v0.99.beta19)
    CVE-2018-20546  (dither.c, v0.99.beta19)
    CVE-2018-20547  (dither.c, v0.99.beta19)
    CVE-2018-20545  (load_image, v0.99.beta19)
    CVE-2018-20548  (load_image, v0.99.beta19)
    CVE-2018-20549  (caca_file_read, 0.99.beta19, not concerned)

See release note[^1] on the github project.

It also allow to migrate the use of the new API instead of libcucul,
which has been merged into libcaca since 0.99.beta15:

    commit f61816ceb7445f8bf818936151554ac060764b39
    Author: Sam Hocevar <sam at hocevar.net>
    Date:   Sat Sep 27 13:12:46 2008 +0000

    Starting refactoring to get rid of libcucul. The initial reason for the
    split is rendered moot by the plugin system: when enabled, binaries do
    not link directly with libX11 or libGL. I hope this is a step towards
    more consisteny and clarity.

It was then completely wiped out by the following commit, which is part
of v0.99.beta20:

    commit 5f0ec215f8c9915ed028324a8ecac8212f68e18d
    Author: Sam Hocevar <sam at hocevar.net>
    Date:   Thu May 3 10:33:30 2018 +0200

    Remove legacy code from 10 years ago.

Check NEWS for details:

    \section news0_99_beta15 Changes between 0.99.beta15 and 0.99.beta14

     - libcucul was merged back into libcaca for more clarity

[^1]: https://github.com/cacalabs/libcaca/releases/tag/v0.99.beta20

- - - - -


7 changed files:

- contrib/src/caca/SHA512SUMS
- − contrib/src/caca/caca-fix-ln-call.patch
- contrib/src/caca/caca-fix-pkgconfig.patch
- − contrib/src/caca/caca-osx-sdkofourchoice.patch
- − contrib/src/caca/caca-win32-static.patch
- contrib/src/caca/rules.mak
- modules/video_output/caca.c


Changes:

=====================================
contrib/src/caca/SHA512SUMS
=====================================
@@ -1 +1 @@
-1d08a45a742cbda2c80810e753b49588cb9073ef545a1d47537745c4e62dc79748a25907903ffee58676d9aa5b75c5e0658666429cf028e10c09157d418c8d19  libcaca-0.99.beta17.tar.gz
+ab03e6c7d17fd152b2d5e9161799531f5e87322e174cb9d25874700f5bc1acfaf8bc2736e733998dad906f793c5a0304740dd39eec04a5e4c3d181bb109b4f23  libcaca-0.99.beta20.tar.gz


=====================================
contrib/src/caca/caca-fix-ln-call.patch deleted
=====================================
@@ -1,61 +0,0 @@
---- caca/caca/Makefile.am	2018-05-16 16:48:26.720331200 +0200
-+++ caca/caca/Makefile.am.ln	2018-05-16 16:47:40.299559100 +0200
-@@ -77,15 +77,15 @@ install-exec-local:
- 	$(mkinstalldirs) $(DESTDIR)$(libdir)
- 	. ./libcaca.la || exit 1; \
- 	for x in $$library_names; do \
--	  ln -sf $$x $(DESTDIR)$(libdir)/$$(echo $$x | sed 's/caca/cucul/g'); \
-+	  $(LN_S)f $$x $(DESTDIR)$(libdir)/$$(echo $$x | sed 's/caca/cucul/g'); \
- 	done
--	ln -sf libcaca.la $(DESTDIR)$(libdir)/libcucul.la
-+	$(LN_S)f libcaca.la $(DESTDIR)$(libdir)/libcucul.la
- 
- install-data-local:
- 	$(mkinstalldirs) $(DESTDIR)$(pkgconfigdir)
--	ln -sf caca.pc $(DESTDIR)$(pkgconfigdir)/cucul.pc
-+	$(LN_S)f caca.pc $(DESTDIR)$(pkgconfigdir)/cucul.pc
- 	$(mkinstalldirs) $(DESTDIR)$(includedir)
--	ln -sf caca.h $(DESTDIR)$(includedir)/cucul.h
-+	$(LN_S)f caca.h $(DESTDIR)$(includedir)/cucul.h
- 
- uninstall-local:
- 	. ./libcaca.la || exit 1; \
---- caca/cxx/Makefile.am	2018-05-16 16:52:26.779732200 +0200
-+++ caca/cxx/Makefile.am.ln	2018-05-16 16:51:42.191400000 +0200
-@@ -26,13 +26,13 @@ install-exec-local:
- 	$(mkinstalldirs) $(DESTDIR)$(libdir)
- 	. ./libcaca++.la || exit 1; \
- 	for x in $$library_names; do \
--	  ln -sf $$x $(DESTDIR)$(libdir)/$$(echo $$x | sed 's/caca/cucul/g'); \
-+	  $(LN_S)f $$x $(DESTDIR)$(libdir)/$$(echo $$x | sed 's/caca/cucul/g'); \
- 	done
--	ln -sf libcaca++.la $(DESTDIR)$(libdir)/libcucul++.la
-+	$(LN_S)f libcaca++.la $(DESTDIR)$(libdir)/libcucul++.la
- 
- install-data-local:
- 	$(mkinstalldirs) $(DESTDIR)$(pkgconfigdir)
--	ln -sf caca++.pc $(DESTDIR)$(pkgconfigdir)/cucul++.pc
-+	$(LN_S)f caca++.pc $(DESTDIR)$(pkgconfigdir)/cucul++.pc
- endif
- 
- uninstall-local:
---- caca/doc/Makefile.am	2018-05-16 16:52:49.359771300 +0200
-+++ caca/doc/Makefile.am.ln	2018-05-16 16:51:49.010973600 +0200
-@@ -42,7 +42,7 @@ clean-local:
- install-data-local:
- if BUILD_DOCUMENTATION
- 	mkdir -p $(DESTDIR)$(datadir)/doc
--	ln -sf libcaca-dev $(DESTDIR)$(datadir)/doc/libcucul-dev
-+	$(LN_S)f libcaca-dev $(DESTDIR)$(datadir)/doc/libcucul-dev
- 	$(mkinstalldirs) $(DESTDIR)$(datadir)/doc/libcaca-dev/html
- 	cp `find html -name '*.html' -o -name '*.gif' -o -name '*.png'` \
- 	  $(DESTDIR)$(datadir)/doc/libcaca-dev/html
-@@ -54,7 +54,7 @@ if BUILD_DOCUMENTATION
- endif
- 	$(mkinstalldirs) $(DESTDIR)$(mandir)/man1
- 	rm -f $(DESTDIR)$(mandir)/man1/cacademo.1
--	ln -sf cacafire.1 $(DESTDIR)$(mandir)/man1/cacademo.1
-+	$(LN_S)f cacafire.1 $(DESTDIR)$(mandir)/man1/cacademo.1
- 
- uninstall-local:
- 	rm -f $(DESTDIR)$(datadir)/doc/libcucul-dev


=====================================
contrib/src/caca/caca-fix-pkgconfig.patch
=====================================
@@ -6,5 +6,6 @@ diff -Naur libcaca-0.99.beta17.a/caca/caca.pc.in libcaca-0.99.beta17.b/caca/caca
  Conflicts: 
  Libs: -L${libdir} -lcaca
 -Libs.private: @ZLIB_LIBS@
+-Cflags: -I${includedir}
 +Libs.private: @ZLIB_LIBS@ @CACA_LIBS@
- Cflags: -I${includedir}
++Cflags: -DCACA_STATIC -I${includedir}


=====================================
contrib/src/caca/caca-osx-sdkofourchoice.patch deleted
=====================================
@@ -1,39 +0,0 @@
---- libcaca/configure.orig	2010-02-08 14:46:58.000000000 +0100
-+++ libcaca/configure	2010-08-09 17:46:59.000000000 +0200
-@@ -16785,33 +16785,9 @@
- done
- 
-   if test "${ac_cv_my_have_cocoa}" = "yes"; then
--    case x${target} in
--    xpowerpc*darwin*)
--      # 10.3 needed to link with X11
--      MACOSX_SDK="${MACOSX_SDK:-/Developer/SDKs/MacOSX10.3.9.sdk}"
--      GCC_VERSION="${GCC_VERSION:-3.3}"
--      ARCH="${ARCH:--arch ppc}"
--      MACOSX_SDK_CFLAGS="${MACOSX_SDK_CFLAGS:--nostdinc -isystem ${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOSX_SDK}/usr/include}"
--      MACOSX_SDK_CXXFLAGS="${MACOSX_SDK_CXXFLAGS:--nostdinc++ -I${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION}/c++ -I${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION}/c++/ppc-darwin -I${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION}/c++/backward}"
--      MACOSX_SDK_LDFLAGS="${MACOSX_SDK_LDFLAGS:--L${MACOSX_SDK}/usr/lib/gcc/darwin -L${MACOSX_SDK}/usr/lib/gcc/darwin/${GCC_VERSION} -L${MACOSX_SDK}/usr/lib}"
--      ;;
--    x*86_64*darwin*)
--      MACOSX_SDK="${MACOSX_SDK:-/Developer/SDKs/MacOSX10.5.sdk}"
--      GCC_VERSION="${GCC_VERSION:-4.0}"
--      ARCH="${ARCH:--arch i386}"
--      MACOSX_SDK_CFLAGS="${MACOSX_SDK_CFLAGS:--isysroot ${MACOSX_SDK}}"
--      MACOSX_SDK_CXXFLAGS="${MACOSX_SDK_CXXFLAGS:-${MACOSX_SDK_CFLAGS}}"
--      ;;
--    x*86*darwin*)
--      MACOSX_SDK="${MACOSX_SDK:-/Developer/SDKs/MacOSX10.6.sdk}"
--      GCC_VERSION="${GCC_VERSION:-4.0}"
--      ARCH="${ARCH:--arch i386}"
--      MACOSX_SDK_CFLAGS="${MACOSX_SDK_CFLAGS:--isysroot ${MACOSX_SDK}}"
--      MACOSX_SDK_CXXFLAGS="${MACOSX_SDK_CXXFLAGS:-${MACOSX_SDK_CFLAGS}}"
--      ;;
--    esac
--    CC="${CC:-gcc-${GCC_VERSION}}"
--    CXX="${CXX:-g++-${GCC_VERSION}}"
-+    MACOSX_SDK=/Developer/SDKs/MacOSX10.5.sdk
-+    MACOSX_SDK_CFLAGS="-isysroot ${MACOSX_SDK}"
-+    MACOSX_SDK_CXXFLAGS="${MACOSX_SDK_CFLAGS}"
-     MACOSX_SDK_FRAMEWORKS="${MACOSX_SDK_FRAMEWORKS:--F${MACOSX_SDK}/System/Library/Frameworks}"
-     CPPFLAGS="${CPPFLAGS} ${ARCH} ${MACOSX_SDK_FRAMEWORKS}"
-     CFLAGS="${CFLAGS} ${MACOSX_SDK_CFLAGS}"


=====================================
contrib/src/caca/caca-win32-static.patch deleted
=====================================
@@ -1,11 +0,0 @@
---- libcaca/caca/caca.h	2010-02-08 13:34:28.000000000 +0100
-+++ libcaca.new/caca/caca.h	2010-08-24 19:27:39.000000000 +0200
-@@ -31,7 +31,7 @@
- #if defined _DOXYGEN_SKIP_ME
- #elif defined _WIN32 && defined __LIBCACA__ && defined DLL_EXPORT
- #   define __extern extern __declspec(dllexport)
--#elif defined _WIN32 && !defined __LIBCACA__
-+#elif defined _WIN32 && !defined __LIBCACA__ && defined __NULL
- #   define __extern extern __declspec(dllimport)
- #else
- #   define __extern extern


=====================================
contrib/src/caca/rules.mak
=====================================
@@ -1,6 +1,6 @@
 # CACA
-CACA_VERSION := 0.99.beta17
-CACA_URL := http://caca.zoy.org/files/libcaca/libcaca-$(CACA_VERSION).tar.gz
+CACA_VERSION := 0.99.beta20
+CACA_URL := https://github.com/cacalabs/libcaca/releases/download/v$(CACA_VERSION)/libcaca-$(CACA_VERSION).tar.gz
 
 ifndef HAVE_DARWIN_OS
 ifndef HAVE_LINUX # see VLC Trac 17251
@@ -10,7 +10,7 @@ endif
 endif
 endif
 
-ifeq ($(call need_pkg,"caca >= 0.99.beta14"),)
+ifeq ($(call need_pkg,"caca >= 0.99.beta19"),)
 PKGS_FOUND += caca
 endif
 
@@ -22,10 +22,6 @@ $(TARBALLS)/libcaca-$(CACA_VERSION).tar.gz:
 caca: libcaca-$(CACA_VERSION).tar.gz .sum-caca
 	$(UNPACK)
 	$(APPLY) $(SRC)/caca/caca-fix-compilation-llvmgcc.patch
-	$(APPLY) $(SRC)/caca/caca-llvm-weak-alias.patch
-	$(APPLY) $(SRC)/caca/caca-osx-sdkofourchoice.patch
-	$(APPLY) $(SRC)/caca/caca-win32-static.patch
-	$(APPLY) $(SRC)/caca/caca-fix-ln-call.patch
 	$(APPLY) $(SRC)/caca/caca-fix-pkgconfig.patch
 	$(call pkg_static,"caca/caca.pc.in")
 	$(UPDATE_AUTOCONFIG)
@@ -36,22 +32,36 @@ CACA_CONF := \
 	--disable-gl \
 	--disable-imlib2 \
 	--disable-doc \
+	--disable-cppunit \
+	--disable-zzuf \
 	--disable-ruby \
 	--disable-csharp \
 	--disable-cxx \
-	--disable-java
+	--disable-java \
+	--disable-python \
+	--disable-cocoa \
+	--disable-network \
+	--disable-vga \
+	--disable-imlib2
 ifdef HAVE_MACOSX
 CACA_CONF += --disable-x11
 endif
 ifdef HAVE_WIN32
-CACA_CONF += --disable-ncurses
+CACA_CONF += --disable-ncurses \
+    ac_cv_func_vsnprintf_s=yes \
+    ac_cv_func_sprintf_s=yes
 endif
 ifdef HAVE_LINUX
 CACA_CONF += --disable-ncurses
 endif
 
+CACA_CONF += \
+	MACOSX_SDK=$(MACOSX_SDK) \
+	MACOSX_SDK_CFLAGS=" " \
+	MACOSX_SDK_CXXFLAGS=" " \
+	CPPFLAGS="$(CPPFLAGS) -DCACA_STATIC"
+
 .caca: caca
-	$(RECONF)
 	cd $< && $(HOSTVARS) ./configure $(HOSTCONF) $(CACA_CONF)
 	cd $< && $(MAKE) -C $< install
 	touch $@


=====================================
modules/video_output/caca.c
=====================================
@@ -48,9 +48,9 @@
 
 /* */
 typedef struct vout_display_sys_t {
-    cucul_canvas_t *cv;
+    caca_canvas_t *cv;
     caca_display_t *dp;
-    cucul_dither_t *dither;
+    caca_dither_t *dither;
 
     bool dead;
     vlc_queue_t q;
@@ -97,8 +97,8 @@ static void Place(vout_display_t *vd)
 {
     vout_display_sys_t *sys = vd->sys;
 
-    const int canvas_width   = cucul_get_canvas_width(sys->cv);
-    const int canvas_height  = cucul_get_canvas_height(sys->cv);
+    const int canvas_width   = caca_get_canvas_width(sys->cv);
+    const int canvas_height  = caca_get_canvas_height(sys->cv);
     const int display_width  = caca_get_display_width(sys->dp);
     const int display_height = caca_get_display_height(sys->dp);
 
@@ -129,7 +129,7 @@ static void Prepare(vout_display_t *vd, picture_t *picture,
 
     if (!sys->dither) {
         /* Create the libcaca dither object */
-        sys->dither = cucul_create_dither(32,
+        sys->dither = caca_create_dither(32,
                                             vd->source->i_visible_width,
                                             vd->source->i_visible_height,
                                             picture->p[0].i_pitch,
@@ -144,12 +144,12 @@ static void Prepare(vout_display_t *vd, picture_t *picture,
         }
     }
 
-    cucul_set_color_ansi(sys->cv, CUCUL_COLOR_DEFAULT, CUCUL_COLOR_BLACK);
-    cucul_clear_canvas(sys->cv);
+    caca_set_color_ansi(sys->cv, CACA_DEFAULT, CACA_BLACK);
+    caca_clear_canvas(sys->cv);
 
     const int crop_offset = vd->source->i_y_offset * picture->p->i_pitch +
                             vd->source->i_x_offset * picture->p->i_pixel_pitch;
-    cucul_dither_bitmap(sys->cv, sys->place.x, sys->place.y,
+    caca_dither_bitmap(sys->cv, sys->place.x, sys->place.y,
                         sys->place.width, sys->place.height,
                         sys->dither,
                         &picture->p->p_pixels[crop_offset]);
@@ -177,7 +177,7 @@ static int Control(vout_display_t *vd, int query)
     switch (query) {
     case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
         if (sys->dither)
-            cucul_free_dither(sys->dither);
+            caca_free_dither(sys->dither);
         sys->dither = NULL;
         /* fall through */
     case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
@@ -358,9 +358,9 @@ static void Close(vout_display_t *vd)
     vlc_join(sys->thread, NULL);
 
     if (sys->dither)
-        cucul_free_dither(sys->dither);
+        caca_free_dither(sys->dither);
     caca_free_display(sys->dp);
-    cucul_free_canvas(sys->cv);
+    caca_free_canvas(sys->cv);
 
 #if defined(_WIN32)
     FreeConsole();
@@ -449,9 +449,9 @@ static int Open(vout_display_t *vd,
     if (!sys)
         goto error;
 
-    sys->cv = cucul_create_canvas(0, 0);
+    sys->cv = caca_create_canvas(0, 0);
     if (!sys->cv) {
-        msg_Err(vd, "cannot initialize libcucul");
+        msg_Err(vd, "cannot initialize libcaca");
         goto error;
     }
 
@@ -503,11 +503,11 @@ static int Open(vout_display_t *vd,
 error:
     if (sys) {
         if (sys->dither)
-            cucul_free_dither(sys->dither);
+            caca_free_dither(sys->dither);
         if (sys->dp)
             caca_free_display(sys->dp);
         if (sys->cv)
-            cucul_free_canvas(sys->cv);
+            caca_free_canvas(sys->cv);
 
         free(sys);
     }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/4d73c1ea474a9cb159367d67be61f3b4ddee49c4...2d5974555729b0915e9280e822cf66c2dd3304f8

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/4d73c1ea474a9cb159367d67be61f3b4ddee49c4...2d5974555729b0915e9280e822cf66c2dd3304f8
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list