[vlc-commits] access/dcp: narrow scope of iteration variable

Filip Roséen git at videolan.org
Wed Oct 12 10:04:37 CEST 2016


vlc | branch: master | Filip Roséen <filip at atch.se> | Tue Oct 11 20:06:13 2016 +0200| [7163e269466b6baedb4946dd114109d1fa9344ea] | committer: Thomas Guillem

access/dcp: narrow scope of iteration variable

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7163e269466b6baedb4946dd114109d1fa9344ea
---

 modules/access/dcp/dcpdecrypt.cpp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/modules/access/dcp/dcpdecrypt.cpp b/modules/access/dcp/dcpdecrypt.cpp
index bc51dd0..e7dcaa9 100644
--- a/modules/access/dcp/dcpdecrypt.cpp
+++ b/modules/access/dcp/dcpdecrypt.cpp
@@ -525,7 +525,6 @@ int RSAKey::readDER( unsigned char const* ps_data_der, size_t length )
     struct tag_info tag_inf;
     gcry_mpi_t key_params[8];
     gcry_error_t err;
-    int i;
 
     /* parse the ASN1 structure */
     if( parseTag( &ps_data_der, &length, &tag_inf )
@@ -539,7 +538,7 @@ int RSAKey::readDER( unsigned char const* ps_data_der, size_t length )
     ps_data_der += tag_inf.length;
     length -= tag_inf.length;
 
-    for( i = 0; i < 8; i++ )
+    for( int i = 0; i < 8; i++ )
     {
         if( parseTag( &ps_data_der, &length, &tag_inf )
                 || tag_inf.tag != TAG_INTEGER || tag_inf.class_ || tag_inf.cons || tag_inf.ndef )
@@ -575,7 +574,7 @@ int RSAKey::readDER( unsigned char const* ps_data_der, size_t length )
     }
 
     /* clear data */
-    for( i = 0; i < 8; i++ )
+    for( int i = 0; i < 8; i++ )
         gcry_mpi_release( key_params[i] );
     return VLC_SUCCESS;
 
@@ -583,7 +582,7 @@ bad_asn1:
     msg_Err( this->p_demux, "could not parse ASN1 structure; key might be corrupted" );
 
 error:
-    for( i = 0; i < 8; i++ )
+    for( int i = 0; i < 8; i++ )
         gcry_mpi_release( key_params[i] );
     return VLC_EGENERIC;
 }



More information about the vlc-commits mailing list