Skip Menu |
 

This queue is for tickets about the Tickit CPAN distribution.

Report information
The Basics
Id: 98211
Status: resolved
Priority: 0/
Queue: Tickit

People
Owner: Nobody in particular
Requestors: TEAM [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.46
Fixed in: 0.47



Subject: ->get_cell bound checking and translation
Download (untitled) / with headers
text/plain 658b
As discussed: Tickit::RenderBuffer->get_cell does not take the current translation into account. The attached case is hopefully valid - the idea is that ->char_at and ->get_cell should be consistent: $rb->char_at(0,0, $ch); is $rb->get_cell(0,0)->char, $ch; Currently working around this with a version check (walk the parents to accumulate total offset), and ->get_cell works fine for valid co-ordinates there. Positions outside the renderbuffer appear to cause a segfault, however (see second case). Things work fine if you pre-validate the values, so it looks like it's just a case of adding the appropriate bounds check to ->get_cell. cheers, Tom
Subject: get_cell.t
Download get_cell.t
text/x-perl 464b
use strict; use warnings; use Test::More; use Tickit::Window; use Tickit::Test; my ( $term, $win ) = mk_term_and_window; my $float = $win->make_float( 2, 2, 3, 3 ); $float->set_on_expose(with_rb => sub { my ($win, $rb, $rect) = @_; $rb->clear; my $ch = ord 'x'; $rb->char_at(0, 0, $ch); is($rb->get_cell(0, 0)->char, $ch, 'have t at 0,0'); isnt($rb->get_cell(2, 2)->char, $ch, 'and something else at 2,2'); }); $win->expose; flush_tickit; done_testing;
Subject: get_cell_segfault.t
Download get_cell_segfault.t
text/x-perl 464b
use strict; use warnings; use Test::More; use Test::Fatal; use Tickit::Window; use Tickit::Test; my ( $term, $win ) = mk_term_and_window; my $float = $win->make_float( 2, 2, 3, 3 ); $float->set_on_expose(with_rb => sub { my ($win, $rb, $rect) = @_; $rb->clear; my $ch = ord 'x'; $rb->char_at(0, 0, $ch); is(exception { $rb->get_cell(300, 300)->char }, undef, 'can request position outside renderbuffer'); }); $win->expose; flush_tickit; done_testing;
Fixed in 0.47 -- Paul Evans


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.