]> git.sesse.net Git - vlc/commitdiff
rar: fix possible use of un undefined value (due to a goto on error).
authorRémi Duraffort <ivoire@videolan.org>
Sun, 4 Jul 2010 06:22:14 +0000 (08:22 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Sun, 4 Jul 2010 06:22:14 +0000 (08:22 +0200)
modules/access/rar/rar.c

index b028f0004d62a976a4d2f60dd18c736a3ecafbca..4079d815b0d8a222e4236f3504f7239757b26d42 100644 (file)
@@ -189,13 +189,16 @@ static int SkipFile(stream_t *s, int *count, rar_file_t ***file, const rar_block
         memcpy(name, &peek[name_offset], name_size);
     }
 
+    rar_file_t *current = NULL;
     if (method != 0x30) {
         msg_Warn(s, "Ignoring compressed file %s (method=0x%2.2x)", name, method);
         goto exit;
     }
 
     /* */
-    rar_file_t *current = *count > 0 ? (*file)[*count - 1] : NULL;
+    if( *count > 0 )
+        current = (*file)[*count - 1];
+
     if (current &&
         (current->is_complete ||
           current->size != file_size ||