Browse Source

cea708: fix CEA708_Window_Truncate()

Make truncation actually drop one column in LTR/RTL (adjust
lastcol/firstcol; delete rows only when they become empty).

Fixes #29328
cherry-pick-c5513cf9
Stanislav Fort 10 months ago
committed by Thomas Guillem
parent
commit
153a13b9be
  1. 16
      modules/codec/cea708.c

16
modules/codec/cea708.c

@ -600,6 +600,8 @@ static void CEA708_Window_Truncate( cea708_window_t *p_w, int i_direction )
for( int i=p_w->i_firstrow; i <= p_w->i_lastrow; i++ )
{
cea708_text_row_t *row = p_w->rows[i];
if (!row)
continue;
if( row->lastcol == i_max )
{
if( row->firstcol >= row->lastcol )
@ -611,6 +613,12 @@ static void CEA708_Window_Truncate( cea708_window_t *p_w, int i_direction )
else if( i == p_w->i_lastrow )
p_w->i_lastrow--;
}
else
{
/* Drop rightmost column */
row->lastcol--;
}
}
}
}
@ -621,6 +629,8 @@ static void CEA708_Window_Truncate( cea708_window_t *p_w, int i_direction )
for( int i=p_w->i_firstrow; i <= p_w->i_lastrow; i++ )
{
cea708_text_row_t *row = p_w->rows[i];
if (!row)
continue;
if( row->firstcol == i_min )
{
if( row->firstcol >= row->lastcol )
@ -632,6 +642,12 @@ static void CEA708_Window_Truncate( cea708_window_t *p_w, int i_direction )
else if( i == p_w->i_lastrow )
p_w->i_lastrow--;
}
else
{
/* Drop leftmost column */
row->firstcol++;
}
}
}
}

Loading…
Cancel
Save