Index: wp-includes/theme.php
===================================================================
--- wp-includes/theme.php	(revision 1899)
+++ wp-includes/theme.php	(working copy)
@@ -310,8 +310,16 @@
 		return $themes;
 
 	sort($theme_files);
+	
+	/* Set the original theme_root and theme_loc values so they can be unfiltered at the start of each iteration. */
+	$orig_theme_root = $theme_root;
+	$orig_theme_loc = $theme_loc;
 
 	foreach ( (array) $theme_files as $theme_file ) {
+		/* Reset the theme_root and theme_loc values as they may have been filtered in the previous iteration. */
+		$theme_root = $orig_theme_root;
+		$theme_loc = $orig_theme_loc;
+		
 		if ( !is_readable("$theme_root/$theme_file") ) {
 			$wp_broken_themes[$theme_file] = array('Name' => $theme_file, 'Title' => $theme_file, 'Description' => __('File not readable.'));
 			continue;
@@ -348,7 +356,10 @@
 		}
 
 		$template = trim($template);
-
+		
+		$theme_root = apply_filters( 'parent_theme_root_' . $template, $theme_root );
+		$theme_loc = apply_filters( 'parent_theme_loc_' . $template, $theme_loc );
+		
 		if ( !file_exists("$theme_root/$template/index.php") ) {
 			$parent_dir = dirname(dirname($theme_file));
 			if ( file_exists("$theme_root/$parent_dir/$template/index.php") ) {
