Commit 5631d280 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

spudec: fix potential buffer underflow

parent fed414c4
...@@ -623,10 +623,13 @@ static int ParseRLE( decoder_t *p_dec, ...@@ -623,10 +623,13 @@ static int ParseRLE( decoder_t *p_dec,
int i, i_inner = -1, i_shade = -1; int i, i_inner = -1, i_shade = -1;
/* Set the border color */ /* Set the border color */
p_spu_data->pi_yuv[i_border][0] = 0x00; if( i_border != -1 )
p_spu_data->pi_yuv[i_border][1] = 0x80; {
p_spu_data->pi_yuv[i_border][2] = 0x80; p_spu_data->pi_yuv[i_border][0] = 0x00;
stats[i_border] = 0; p_spu_data->pi_yuv[i_border][1] = 0x80;
p_spu_data->pi_yuv[i_border][2] = 0x80;
stats[i_border] = 0;
}
/* Find the inner colors */ /* Find the inner colors */
for( i = 0 ; i < 4 && i_inner == -1 ; i++ ) for( i = 0 ; i < 4 && i_inner == -1 ; i++ )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment