Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libansilove for openSUSE:Factory 
checked in at 2022-05-05 23:07:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libansilove (Old)
 and      /work/SRC/openSUSE:Factory/.libansilove.new.1538 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libansilove"

Thu May  5 23:07:40 2022 rev:15 rq:975252 version:1.3.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/libansilove/libansilove.changes  2022-02-13 
00:16:18.632271736 +0100
+++ /work/SRC/openSUSE:Factory/.libansilove.new.1538/libansilove.changes        
2022-05-05 23:08:26.393710579 +0200
@@ -1,0 +2,7 @@
+Thu May  5 05:57:06 UTC 2022 - Christophe Giboudeaux <christo...@krop.fr>
+
+- Update to 1.3.1
+  * Increment pcboard_buffer by more than one element at a time
+  * Fix XBin font memory leaks
+
+-------------------------------------------------------------------

Old:
----
  libansilove-1.2.9.tar.gz

New:
----
  libansilove-1.3.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libansilove.spec ++++++
--- /var/tmp/diff_new_pack.fTTTLn/_old  2022-05-05 23:08:26.849711148 +0200
+++ /var/tmp/diff_new_pack.fTTTLn/_new  2022-05-05 23:08:26.853711153 +0200
@@ -20,7 +20,7 @@
 %global sover   1
 %global libname %{name}%{sover}
 Name:           libansilove
-Version:        1.2.9
+Version:        1.3.1
 Release:        0
 Summary:        Library for converting ANSI, ASCII, and other formats to PNG
 License:        BSD-2-Clause
@@ -77,6 +77,9 @@
 %install
 %cmake_install
 
+# Only keep the shared library
+rm %{buildroot}%{_libdir}/libansilove-static.a
+
 %post -n %{libname} -p /sbin/ldconfig
 %postun -n %{libname} -p /sbin/ldconfig
 

++++++ libansilove-1.2.9.tar.gz -> libansilove-1.3.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/CMakeLists.txt 
new/libansilove-1.3.1/CMakeLists.txt
--- old/libansilove-1.2.9/CMakeLists.txt        2022-02-10 21:00:58.000000000 
+0100
+++ new/libansilove-1.3.1/CMakeLists.txt        2022-04-26 09:35:14.000000000 
+0200
@@ -1,8 +1,8 @@
 cmake_minimum_required(VERSION 3.1)
 
 set(LIB_VERSION_MAJOR 1)
-set(LIB_VERSION_MINOR 2)
-set(LIB_VERSION_PATCH 9)
+set(LIB_VERSION_MINOR 3)
+set(LIB_VERSION_PATCH 1)
 set(LIB_VERSION_STRING 
${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR}.${LIB_VERSION_PATCH})
 
 set(CMAKE_C_STANDARD 99)
@@ -38,7 +38,12 @@
 endif()
 
 add_definitions(-D_GNU_SOURCE -Wall -Wextra -pedantic)
-add_library(ansilove SHARED ${SRC} ${LOADERS})
+
+add_library(objlib OBJECT ${SRC} ${LOADERS})
+set_property(TARGET objlib PROPERTY POSITION_INDEPENDENT_CODE ON)
+
+add_library(ansilove SHARED $<TARGET_OBJECTS:objlib>)
+add_library(ansilove-static STATIC $<TARGET_OBJECTS:objlib>)
 
 target_link_libraries(ansilove ${GD_LIBRARIES} m)
 
@@ -47,6 +52,7 @@
   C_VISIBILITY_PRESET hidden)
 
 install(TARGETS ansilove DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(TARGETS ansilove-static DESTINATION ${CMAKE_INSTALL_LIBDIR})
 install(FILES include/ansilove.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
 install(FILES man/libansilove.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3/)
 install(FILES man/ansilove_clean.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3/)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/ChangeLog 
new/libansilove-1.3.1/ChangeLog
--- old/libansilove-1.2.9/ChangeLog     2022-02-10 21:00:58.000000000 +0100
+++ new/libansilove-1.3.1/ChangeLog     2022-04-26 09:35:14.000000000 +0200
@@ -1,10 +1,26 @@
+libansilove 1.3.1 (2022-04-26)
+
+- Increment pcboard_buffer by more than one element at a time
+- Fix XBin font memory leaks
+
+
+
+libansilove 1.3.0 (2022-04-14)
+
+- Properly handle 512 characters XBin fonts
+- Add a link to the Gentoo package in the README
+- Also build and install libansilove as a static library
+- List projects using libansilove in the README
+
+
+
 libansilove 1.2.9 (2022-02-10)
 
-- Stop forcing FORTIFY_SOURCE=2, it should be package builders decision.
-- Bump CMake minimum required version to 3.1.
-- Add SPDX short license identifier in source files.
-- Use CMAKE_C_STANDARD instead of hardcoding compiler flags.
-- Add missing <stdint.h> include.
+- Stop forcing FORTIFY_SOURCE=2, it should be package builders decision
+- Bump CMake minimum required version to 3.1
+- Add SPDX short license identifier in source files
+- Use CMAKE_C_STANDARD instead of hardcoding compiler flags
+- Add missing <stdint.h> include
 
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/README.md 
new/libansilove-1.3.1/README.md
--- old/libansilove-1.2.9/README.md     2022-02-10 21:00:58.000000000 +0100
+++ new/libansilove-1.3.1/README.md     2022-04-26 09:35:14.000000000 +0200
@@ -41,6 +41,7 @@
 - [Ubuntu][5]
 - [openSUSE][6]
 - [Solus][7]
+- [Gentoo][8]
 
 # Features
 
@@ -61,23 +62,30 @@
 See the `example` directory for an example showing how to use the library to
 convert a file to PNG.
 
-# Who pulls the strings
+# Projects using libansilove
 
-libansilove is developed by Stefan Vogt ([@ByteProject][8]), Brian Cassidy
-([@bricas][9]) and Frederic Cambus ([@fcambus][10]).
+- [Ansilove][9] - ASCII / ANSI art to PNG converter, also supporting several 
artscene file formats
+- [ANSi View (PS3)][10] - ANSi and artscene related file formats viewer for 
the PlayStation 3
+
+# Bindings
+
+Bindings for other programming languages:
+
+- [Racket][11]
 
 # License
 
 libansilove is released under the BSD 2-Clause license. See the file `LICENSE` 
for details.
 
-# Bindings
-
-Bindings for programming languages:
+# Authors
 
-- [Racket][11]
+libansilove is developed by Stefan Vogt ([@ByteProject][12]), Brian Cassidy
+([@bricas][13]) and Frederic Cambus ([@fcambus][14]).
 
 # Resources
 
+Project homepage: https://www.ansilove.org
+
 GitHub: https://github.com/ansilove/libansilove
 
 [1]: https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/graphics/libansilove
@@ -87,7 +95,10 @@
 [5]: https://packages.ubuntu.com/search?keywords=libansilove
 [6]: https://software.opensuse.org/package/libansilove
 [7]: https://dev.getsol.us/source/libansilove/
-[8]: https://github.com/ByteProject
-[9]: https://github.com/bricas
-[10]: https://github.com/fcambus
+[8]: https://packages.gentoo.org/packages/dev-libs/libansilove
+[9]: https://github.com/ansilove/ansilove
+[10]: https://github.com/bucanero/ansiview-ps3
 [11]: https://gitlab.com/xgqt/racket-libansilove
+[12]: https://github.com/ByteProject
+[13]: https://github.com/bricas
+[14]: https://github.com/fcambus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/include/ansilove.h 
new/libansilove-1.3.1/include/ansilove.h
--- old/libansilove-1.2.9/include/ansilove.h    2022-02-10 21:00:58.000000000 
+0100
+++ new/libansilove-1.3.1/include/ansilove.h    2022-04-26 09:35:14.000000000 
+0200
@@ -1,6 +1,6 @@
 /*
  * ansilove.h
- * libansilove 1.2.9
+ * libansilove 1.3.1
  * https://www.ansilove.org
  *
  * Copyright (c) 2011-2022 Stefan Vogt, Brian Cassidy, and Frederic Cambus
@@ -26,11 +26,11 @@
 #define ANSILOVE_EXTERN __attribute__((visibility("default")))
 
 /* Version number */
-#define ANSILOVE_VERSION "1.2.9"
+#define ANSILOVE_VERSION "1.3.1"
 
 #define ANSILOVE_VERSION_MAJOR         1
-#define ANSILOVE_VERSION_MINOR         2
-#define ANSILOVE_VERSION_PATCH         9
+#define ANSILOVE_VERSION_MINOR         3
+#define ANSILOVE_VERSION_PATCH         1
 
 /* Error codes */
 #define ANSILOVE_INVALID_PARAM         1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/src/clean.c 
new/libansilove-1.3.1/src/clean.c
--- old/libansilove-1.2.9/src/clean.c   2022-02-10 21:00:58.000000000 +0100
+++ new/libansilove-1.3.1/src/clean.c   2022-04-26 09:35:14.000000000 +0200
@@ -1,6 +1,6 @@
 /*
  * clean.c
- * libansilove 1.2.9
+ * libansilove 1.3.1
  * https://www.ansilove.org
  *
  * Copyright (c) 2011-2022 Stefan Vogt, Brian Cassidy, and Frederic Cambus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/src/config.h 
new/libansilove-1.3.1/src/config.h
--- old/libansilove-1.2.9/src/config.h  2022-02-10 21:00:58.000000000 +0100
+++ new/libansilove-1.3.1/src/config.h  2022-04-26 09:35:14.000000000 +0200
@@ -1,6 +1,6 @@
 /*
  * config.h
- * libansilove 1.2.9
+ * libansilove 1.3.1
  * https://www.ansilove.org
  *
  * Copyright (c) 2011-2022 Stefan Vogt, Brian Cassidy, and Frederic Cambus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/src/drawchar.c 
new/libansilove-1.3.1/src/drawchar.c
--- old/libansilove-1.2.9/src/drawchar.c        2022-02-10 21:00:58.000000000 
+0100
+++ new/libansilove-1.3.1/src/drawchar.c        2022-04-26 09:35:14.000000000 
+0200
@@ -1,6 +1,6 @@
 /*
  * drawchar.c
- * libansilove 1.2.9
+ * libansilove 1.3.1
  * https://www.ansilove.org
  *
  * Copyright (c) 2011-2022 Stefan Vogt, Brian Cassidy, and Frederic Cambus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/src/drawchar.h 
new/libansilove-1.3.1/src/drawchar.h
--- old/libansilove-1.2.9/src/drawchar.h        2022-02-10 21:00:58.000000000 
+0100
+++ new/libansilove-1.3.1/src/drawchar.h        2022-04-26 09:35:14.000000000 
+0200
@@ -1,6 +1,6 @@
 /*
  * drawchar.h
- * libansilove 1.2.9
+ * libansilove 1.3.1
  * https://www.ansilove.org
  *
  * Copyright (c) 2011-2022 Stefan Vogt, Brian Cassidy, and Frederic Cambus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/src/error.c 
new/libansilove-1.3.1/src/error.c
--- old/libansilove-1.2.9/src/error.c   2022-02-10 21:00:58.000000000 +0100
+++ new/libansilove-1.3.1/src/error.c   2022-04-26 09:35:14.000000000 +0200
@@ -1,6 +1,6 @@
 /*
  * error.c
- * libansilove 1.2.9
+ * libansilove 1.3.1
  * https://www.ansilove.org
  *
  * Copyright (c) 2011-2022 Stefan Vogt, Brian Cassidy, and Frederic Cambus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/src/fonts.c 
new/libansilove-1.3.1/src/fonts.c
--- old/libansilove-1.2.9/src/fonts.c   2022-02-10 21:00:58.000000000 +0100
+++ new/libansilove-1.3.1/src/fonts.c   2022-04-26 09:35:14.000000000 +0200
@@ -1,6 +1,6 @@
 /*
  * fonts.c
- * libansilove 1.2.9
+ * libansilove 1.3.1
  * https://www.ansilove.org
  *
  * Copyright (c) 2011-2022 Stefan Vogt, Brian Cassidy, and Frederic Cambus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/src/fonts.h 
new/libansilove-1.3.1/src/fonts.h
--- old/libansilove-1.2.9/src/fonts.h   2022-02-10 21:00:58.000000000 +0100
+++ new/libansilove-1.3.1/src/fonts.h   2022-04-26 09:35:14.000000000 +0200
@@ -1,6 +1,6 @@
 /*
  * fonts.h
- * libansilove 1.2.9
+ * libansilove 1.3.1
  * https://www.ansilove.org
  *
  * Copyright (c) 2011-2022 Stefan Vogt, Brian Cassidy, and Frederic Cambus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/src/init.c 
new/libansilove-1.3.1/src/init.c
--- old/libansilove-1.2.9/src/init.c    2022-02-10 21:00:58.000000000 +0100
+++ new/libansilove-1.3.1/src/init.c    2022-04-26 09:35:14.000000000 +0200
@@ -1,6 +1,6 @@
 /*
  * init.c
- * libansilove 1.2.9
+ * libansilove 1.3.1
  * https://www.ansilove.org
  *
  * Copyright (c) 2011-2022 Stefan Vogt, Brian Cassidy, and Frederic Cambus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/src/loaders/ansi.c 
new/libansilove-1.3.1/src/loaders/ansi.c
--- old/libansilove-1.2.9/src/loaders/ansi.c    2022-02-10 21:00:58.000000000 
+0100
+++ new/libansilove-1.3.1/src/loaders/ansi.c    2022-04-26 09:35:14.000000000 
+0200
@@ -1,6 +1,6 @@
 /*
  * ansi.c
- * libansilove 1.2.9
+ * libansilove 1.3.1
  * https://www.ansilove.org
  *
  * Copyright (c) 2011-2022 Stefan Vogt, Brian Cassidy, and Frederic Cambus
@@ -180,13 +180,11 @@
                                if (row > rowMax)
                                        rowMax = row;
 
-                               /* write current character in ansiChar 
structure */
                                /* reallocate structure array memory */
                                if (structIndex == ansi_buffer_size) {
                                        ansi_buffer_size += ANSI_BUFFER_SIZE;
 
                                        ptr = reallocarray(ansi_buffer, 
ansi_buffer_size, sizeof(struct ansiChar));
-
                                        if (ptr == NULL) {
                                                ctx->error = 
ANSILOVE_MEMORY_ERROR;
                                                goto error;
@@ -195,6 +193,7 @@
                                        ansi_buffer = ptr;
                                }
 
+                               /* write current character in ansiChar 
structure */
                                if (invert) {
                                        ansi_buffer[structIndex].background = 
foreground % 8;
                                        ansi_buffer[structIndex].foreground = 
background + (foreground & 8);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/src/loaders/artworx.c 
new/libansilove-1.3.1/src/loaders/artworx.c
--- old/libansilove-1.2.9/src/loaders/artworx.c 2022-02-10 21:00:58.000000000 
+0100
+++ new/libansilove-1.3.1/src/loaders/artworx.c 2022-04-26 09:35:14.000000000 
+0200
@@ -1,6 +1,6 @@
 /*
  * artworx.c
- * libansilove 1.2.9
+ * libansilove 1.3.1
  * https://www.ansilove.org
  *
  * Copyright (c) 2011-2022 Stefan Vogt, Brian Cassidy, and Frederic Cambus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/src/loaders/binary.c 
new/libansilove-1.3.1/src/loaders/binary.c
--- old/libansilove-1.2.9/src/loaders/binary.c  2022-02-10 21:00:58.000000000 
+0100
+++ new/libansilove-1.3.1/src/loaders/binary.c  2022-04-26 09:35:14.000000000 
+0200
@@ -1,6 +1,6 @@
 /*
  * binary.c
- * libansilove 1.2.9
+ * libansilove 1.3.1
  * https://www.ansilove.org
  *
  * Copyright (c) 2011-2022 Stefan Vogt, Brian Cassidy, and Frederic Cambus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/src/loaders/icedraw.c 
new/libansilove-1.3.1/src/loaders/icedraw.c
--- old/libansilove-1.2.9/src/loaders/icedraw.c 2022-02-10 21:00:58.000000000 
+0100
+++ new/libansilove-1.3.1/src/loaders/icedraw.c 2022-04-26 09:35:14.000000000 
+0200
@@ -1,6 +1,6 @@
 /*
  * icedraw.c
- * libansilove 1.2.9
+ * libansilove 1.3.1
  * https://www.ansilove.org
  *
  * Copyright (c) 2011-2022 Stefan Vogt, Brian Cassidy, and Frederic Cambus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/src/loaders/pcboard.c 
new/libansilove-1.3.1/src/loaders/pcboard.c
--- old/libansilove-1.2.9/src/loaders/pcboard.c 2022-02-10 21:00:58.000000000 
+0100
+++ new/libansilove-1.3.1/src/loaders/pcboard.c 2022-04-26 09:35:14.000000000 
+0200
@@ -1,6 +1,6 @@
 /*
  * pcboard.c
- * libansilove 1.2.9
+ * libansilove 1.3.1
  * https://www.ansilove.org
  *
  * Copyright (c) 2011-2022 Stefan Vogt, Brian Cassidy, and Frederic Cambus
@@ -26,6 +26,8 @@
 #include "reallocarray.h"
 #endif
 
+#define PCB_BUFFER_SIZE 4096
+
 #define STATE_TEXT     0
 #define STATE_SEQUENCE 1
 #define STATE_END      2
@@ -53,6 +55,8 @@
        /* PCB buffer structure array definition */
        struct pcbChar *ptr, *pcboard_buffer = NULL;
 
+       size_t pcb_buffer_size = PCB_BUFFER_SIZE;
+
        /* libgd image pointers */
        gdImagePtr canvas;
 
@@ -86,7 +90,7 @@
        select_font(&fontData, options->font);
 
        /* PCB buffer dynamic memory allocation */
-       pcboard_buffer = malloc(sizeof (struct pcbChar));
+       pcboard_buffer = malloc(pcb_buffer_size * sizeof(struct pcbChar));
 
        if (pcboard_buffer == NULL) {
                ctx->error = ANSILOVE_MEMORY_ERROR;
@@ -126,13 +130,17 @@
                                        rowMax = row;
 
                                /* reallocate structure array memory */
-                               ptr = reallocarray(pcboard_buffer, structIndex 
+ 1, sizeof(struct pcbChar));
-                               if (ptr == NULL) {
-                                       ctx->error = ANSILOVE_MEMORY_ERROR;
-                                       goto error;
-                               }
+                               if (structIndex == pcb_buffer_size) {
+                                       pcb_buffer_size += PCB_BUFFER_SIZE;
 
-                               pcboard_buffer = ptr;
+                                       ptr = reallocarray(pcboard_buffer, 
pcb_buffer_size, sizeof(struct pcbChar));
+                                       if (ptr == NULL) {
+                                               ctx->error = 
ANSILOVE_MEMORY_ERROR;
+                                               goto error;
+                                       }
+
+                                       pcboard_buffer = ptr;
+                               }
 
                                /* write current character in pcbChar struct */
                                pcboard_buffer[structIndex] = (struct pcbChar) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/src/loaders/tundra.c 
new/libansilove-1.3.1/src/loaders/tundra.c
--- old/libansilove-1.2.9/src/loaders/tundra.c  2022-02-10 21:00:58.000000000 
+0100
+++ new/libansilove-1.3.1/src/loaders/tundra.c  2022-04-26 09:35:14.000000000 
+0200
@@ -1,6 +1,6 @@
 /*
  * tundra.c
- * libansilove 1.2.9
+ * libansilove 1.3.1
  * https://www.ansilove.org
  *
  * Copyright (c) 2011-2022 Stefan Vogt, Brian Cassidy, and Frederic Cambus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/src/loaders/xbin.c 
new/libansilove-1.3.1/src/loaders/xbin.c
--- old/libansilove-1.2.9/src/loaders/xbin.c    2022-02-10 21:00:58.000000000 
+0100
+++ new/libansilove-1.3.1/src/loaders/xbin.c    2022-04-26 09:35:14.000000000 
+0200
@@ -1,6 +1,6 @@
 /*
  * xbin.c
- * libansilove 1.2.9
+ * libansilove 1.3.1
  * https://www.ansilove.org
  *
  * Copyright (c) 2011-2022 Stefan Vogt, Brian Cassidy, and Frederic Cambus
@@ -30,6 +30,7 @@
 {
        const uint8_t *font_data;
        uint8_t *font_data_xbin = NULL;
+       uint8_t *high_font_data_xbin = NULL;
        uint32_t width, height;
        uint32_t colors[16];
        uint32_t offset = XBIN_HEADER_LENGTH;
@@ -117,8 +118,7 @@
 
        /* font */
        if ((xbin_flags & 2) == 2) {
-               uint32_t numchars = (xbin_flags & 0x10 ? 512 : 256);
-               size_t fontsz = xbin_fontsize * numchars;
+               size_t fontsz = xbin_fontsize * 256;
 
                if (offset + fontsz > ctx->length) {
                        ctx->error = ANSILOVE_FORMAT_ERROR;
@@ -137,6 +137,28 @@
                font_data = font_data_xbin;
 
                offset += fontsz;
+
+                /* 512 char font */
+               if (xbin_flags & 0x10) {
+                       if (offset + fontsz > ctx->length) {
+                               ctx->error = ANSILOVE_FORMAT_ERROR;
+                               free(font_data_xbin);
+                               return -1;
+                       }
+
+                       /* allocate memory to contain the XBin font */
+                       high_font_data_xbin = (uint8_t *)malloc(fontsz);
+                       if (high_font_data_xbin == NULL) {
+                               ctx->error = ANSILOVE_MEMORY_ERROR;
+                               free(font_data_xbin);
+                               return -1;
+                       }
+
+                       memcpy(high_font_data_xbin, ctx->buffer+offset, fontsz);
+
+                       offset += fontsz;
+                }
+
        } else {
                /* using default 80x25 font */
                font_data = font_pc_80x25;
@@ -163,6 +185,7 @@
                                        } else {
                                                ctx->error = 
ANSILOVE_FORMAT_ERROR;
                                                free(font_data_xbin);
+                                               free(high_font_data_xbin);
                                                return -1;
                                        }
                                }
@@ -199,9 +222,16 @@
                                background = (attribute & 240) >> 4;
                                foreground = attribute & 15;
 
-                               drawchar(canvas, font_data, 8, xbin_fontsize,
-                                   column, row, colors[background],
-                                   colors[foreground], character);
+                               if (xbin_flags & 0x10 && attribute & 8) {
+                                       drawchar(canvas, high_font_data_xbin, 
8, xbin_fontsize,
+                                           column, row, colors[background],
+                                           colors[foreground], character);
+                               }
+                               else {
+                                       drawchar(canvas, font_data, 8, 
xbin_fontsize,
+                                           column, row, colors[background],
+                                           colors[foreground], character);
+                               }
 
                                column++;
 
@@ -225,9 +255,16 @@
                        background = (attribute & 240) >> 4;
                        foreground = attribute & 15;
 
-                       drawchar(canvas, font_data, 8, xbin_fontsize,
-                           column, row, colors[background],
-                           colors[foreground], character);
+                       if (xbin_flags & 0x10 && attribute & 8) {
+                               drawchar(canvas, high_font_data_xbin, 8, 
xbin_fontsize,
+                                   column, row, colors[background],
+                                   colors[foreground], character);
+                       }
+                       else {
+                               drawchar(canvas, font_data, 8, xbin_fontsize,
+                                   column, row, colors[background],
+                                   colors[foreground], character);
+                       }
 
                        column++;
                        offset += 2;
@@ -237,11 +274,13 @@
        /* create output file */
        if (output(ctx, options, canvas) != 0) {
                free(font_data_xbin);
+               free(high_font_data_xbin);
                font_data = NULL;
                return -1;
        }
 
        free(font_data_xbin);
+       free(high_font_data_xbin);
 
        return 0;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/src/loadfile.c 
new/libansilove-1.3.1/src/loadfile.c
--- old/libansilove-1.2.9/src/loadfile.c        2022-02-10 21:00:58.000000000 
+0100
+++ new/libansilove-1.3.1/src/loadfile.c        2022-04-26 09:35:14.000000000 
+0200
@@ -1,6 +1,6 @@
 /*
  * loadfile.c
- * libansilove 1.2.9
+ * libansilove 1.3.1
  * https://www.ansilove.org
  *
  * Copyright (c) 2011-2022 Stefan Vogt, Brian Cassidy, and Frederic Cambus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/src/output.c 
new/libansilove-1.3.1/src/output.c
--- old/libansilove-1.2.9/src/output.c  2022-02-10 21:00:58.000000000 +0100
+++ new/libansilove-1.3.1/src/output.c  2022-04-26 09:35:14.000000000 +0200
@@ -1,6 +1,6 @@
 /*
  * output.c
- * libansilove 1.2.9
+ * libansilove 1.3.1
  * https://www.ansilove.org
  *
  * Copyright (c) 2011-2022 Stefan Vogt, Brian Cassidy, and Frederic Cambus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/src/output.h 
new/libansilove-1.3.1/src/output.h
--- old/libansilove-1.2.9/src/output.h  2022-02-10 21:00:58.000000000 +0100
+++ new/libansilove-1.3.1/src/output.h  2022-04-26 09:35:14.000000000 +0200
@@ -1,6 +1,6 @@
 /*
  * output.h
- * libansilove 1.2.9
+ * libansilove 1.3.1
  * https://www.ansilove.org
  *
  * Copyright (c) 2011-2022 Stefan Vogt, Brian Cassidy, and Frederic Cambus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libansilove-1.2.9/src/savefile.c 
new/libansilove-1.3.1/src/savefile.c
--- old/libansilove-1.2.9/src/savefile.c        2022-02-10 21:00:58.000000000 
+0100
+++ new/libansilove-1.3.1/src/savefile.c        2022-04-26 09:35:14.000000000 
+0200
@@ -1,6 +1,6 @@
 /*
  * savefile.c
- * libansilove 1.2.9
+ * libansilove 1.3.1
  * https://www.ansilove.org
  *
  * Copyright (c) 2011-2022 Stefan Vogt, Brian Cassidy, and Frederic Cambus

Reply via email to