[vlc-commits] dvbsub: fix variable shadowing
Rémi Denis-Courmont
git at videolan.org
Thu Jun 29 22:35:11 CEST 2017
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jun 29 22:58:52 2017 +0300| [35ad1d317b6120948a81a77ecffa41a4f3f802ea] | committer: Rémi Denis-Courmont
dvbsub: fix variable shadowing
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=35ad1d317b6120948a81a77ecffa41a4f3f802ea
---
modules/codec/dvbsub.c | 37 +++++++++++++++++--------------------
1 file changed, 17 insertions(+), 20 deletions(-)
diff --git a/modules/codec/dvbsub.c b/modules/codec/dvbsub.c
index 495e5f9ac4..568ccdfbc5 100644
--- a/modules/codec/dvbsub.c
+++ b/modules/codec/dvbsub.c
@@ -706,11 +706,8 @@ static void decode_clut( decoder_t *p_dec, bs_t *s )
while( i_processed_length < i_segment_length )
{
uint8_t y, cb, cr, t;
- uint8_t i_id;
- uint8_t i_type;
-
- i_id = bs_read( s, 8 );
- i_type = bs_read( s, 3 );
+ uint_fast8_t cid = bs_read( s, 8 );
+ uint_fast8_t type = bs_read( s, 3 );
bs_skip( s, 4 );
@@ -743,26 +740,26 @@ static void decode_clut( decoder_t *p_dec, bs_t *s )
/* According to EN 300-743 section 7.2.3 note 1, type should
* not have more than 1 bit set to one, but some streams don't
* respect this note. */
- if( ( i_type & 0x04 ) && ( i_id < 4 ) )
+ if( ( type & 0x04 ) && ( cid < 4 ) )
{
- p_clut->c_2b[i_id].Y = y;
- p_clut->c_2b[i_id].Cr = cr;
- p_clut->c_2b[i_id].Cb = cb;
- p_clut->c_2b[i_id].T = t;
+ p_clut->c_2b[cid].Y = y;
+ p_clut->c_2b[cid].Cr = cr;
+ p_clut->c_2b[cid].Cb = cb;
+ p_clut->c_2b[cid].T = t;
}
- if( ( i_type & 0x02 ) && ( i_id < 16 ) )
+ if( ( type & 0x02 ) && ( cid < 16 ) )
{
- p_clut->c_4b[i_id].Y = y;
- p_clut->c_4b[i_id].Cr = cr;
- p_clut->c_4b[i_id].Cb = cb;
- p_clut->c_4b[i_id].T = t;
+ p_clut->c_4b[cid].Y = y;
+ p_clut->c_4b[cid].Cr = cr;
+ p_clut->c_4b[cid].Cb = cb;
+ p_clut->c_4b[cid].T = t;
}
- if( i_type & 0x01 )
+ if( type & 0x01 )
{
- p_clut->c_8b[i_id].Y = y;
- p_clut->c_8b[i_id].Cr = cr;
- p_clut->c_8b[i_id].Cb = cb;
- p_clut->c_8b[i_id].T = t;
+ p_clut->c_8b[cid].Y = y;
+ p_clut->c_8b[cid].Cr = cr;
+ p_clut->c_8b[cid].Cb = cb;
+ p_clut->c_8b[cid].T = t;
}
}
}
More information about the vlc-commits
mailing list