]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
If a volume description is found, do not try checking of another
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 8 Nov 2009 10:23:59 +0000 (05:23 -0500)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 8 Nov 2009 10:23:59 +0000 (05:23 -0500)
volume description.

SVN-Revision: 1591

libarchive/archive_read_support_format_iso9660.c

index a913b38d9480bec12c8db7ea444b7b95e4508614..5bb16fa0c90cb81d53b977e46f578da44a611b0a 100644 (file)
@@ -483,29 +483,33 @@ archive_read_format_iso9660_bid(struct archive_read *a)
        seenTerminator = 0;
        for (; bytes_read > LOGICAL_BLOCK_SIZE;
            bytes_read -= LOGICAL_BLOCK_SIZE, p += LOGICAL_BLOCK_SIZE) {
-               int bid = 0;
-
                /* Do not handle undefined Volume Descriptor Type. */
                if (p[0] >= 4 && p[0] <= 254)
                        return (0);
                /* Standard Identifier must be "CD001" */
                if (memcmp(p + 1, "CD001", 5) != 0)
                        return (0);
-               if (!iso9660->primary.location)
-                       bid += isPVD(iso9660, p);
-               if (!iso9660->joliet.location)
-                       bid += isJolietSVD(iso9660, p);
-               bid += isBootRecord(p);
-               bid += isEVD(p);
-               bid += isSVD(p);
-               bid += isVolumePartition(iso9660, p);
-               if (bid == 0) {
-                       if (isVDSetTerminator(p)) {
-                               seenTerminator = 1;
-                               break;
-                       }
-                       return (0);
+               if (!iso9660->primary.location) {
+                       if (isPVD(iso9660, p))
+                               continue;
                }
+               if (!iso9660->joliet.location) {
+                       if (isJolietSVD(iso9660, p))
+                               continue;
+               }
+               if (isBootRecord(p))
+                       continue;
+               if (isEVD(p))
+                       continue;
+               if (isSVD(p))
+                       continue;
+               if (isVolumePartition(iso9660, p))
+                       continue;
+               if (isVDSetTerminator(p)) {
+                       seenTerminator = 1;
+                       break;
+               }
+               return (0);
        }
        /*
         * ISO 9660 format must have Primary Volume Descriptor and