diff --git a/src/lib/sixel.c b/src/lib/sixel.c index e9c5ef63e..c3bd2deb9 100644 --- a/src/lib/sixel.c +++ b/src/lib/sixel.c @@ -743,16 +743,10 @@ sixel_blit_inner(int leny, int lenx, sixeltable* stab, int sixel_blit(ncplane* n, int linesize, const void* data, int leny, int lenx, const blitterargs* bargs, int bpp __attribute__ ((unused))){ int colorregs = bargs->u.pixel.colorregs; - if(colorregs <= 0){ - return -1; - } if(colorregs > 256){ colorregs = 256; } - // FIXME enforce this in discovery, possibly raising the value - if(colorregs < 64){ - return -1; - } + assert(colorregs >= 64); sixeltable stable = { .map = sixelmap_create(colorregs, leny - bargs->begy, lenx - bargs->begx), .deets = malloc(colorregs * sizeof(cdetails)), diff --git a/src/lib/termdesc.c b/src/lib/termdesc.c index f17fa4432..d2c2588b8 100644 --- a/src/lib/termdesc.c +++ b/src/lib/termdesc.c @@ -493,6 +493,9 @@ query_sixel_details(tinfo* ti, int fd){ return -1; } //fprintf(stderr, "Sixel ColorRegs: %d Max_x: %d Max_y: %d\n", ti->color_registers, ti->sixel_maxx, ti->sixel_maxy); + if(ti->color_registers < 64){ // FIXME try to drive it higher + return -1; + } return 0; }