[sixel] don't use more than 65534 color registers

pull/2617/head
nick black 2 years ago committed by nick black
parent ce7d1f20f3
commit c8c92a1e8c

@ -9,6 +9,8 @@ extern "C" {
#include <stdbool.h>
#include "fbuf.h"
#define SIXEL_MAX_REGISTERS 65534 // 65535 is used for transparent
struct tinfo;
struct ncpile;
struct ncplane;

@ -1215,7 +1215,9 @@ handle_responses(tinfo* ti, size_t* tablelen, size_t* tableused,
}
// kitty trumps sixel, when both are available
if((*kitty_graphics = iresp->kitty_graphics) == 0){
ti->color_registers = iresp->color_registers;
if((ti->color_registers = iresp->color_registers) > SIXEL_MAX_REGISTERS){
ti->color_registers = SIXEL_MAX_REGISTERS;
}
ti->sixel_maxy_pristine = iresp->sixely;
ti->sixel_maxy = iresp->sixely;
ti->sixel_maxx = iresp->sixelx;

Loading…
Cancel
Save