]> granicus.if.org Git - file/commitdiff
PR/553: Use proper sector size for SAT.
authorChristos Zoulas <christos@zoulas.com>
Wed, 1 Jun 2016 22:21:14 +0000 (22:21 +0000)
committerChristos Zoulas <christos@zoulas.com>
Wed, 1 Jun 2016 22:21:14 +0000 (22:21 +0000)
src/cdf.c

index cc587fcaba98b4508c2a66d49bcc0da3d8a5f124..763083fc4775aeac646d447f9d78d9a9d7ae59a3 100644 (file)
--- a/src/cdf.c
+++ b/src/cdf.c
@@ -35,7 +35,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: cdf.c,v 1.80 2016/05/06 15:17:10 christos Exp $")
+FILE_RCSID("@(#)$File: cdf.c,v 1.81 2016/06/01 22:21:14 christos Exp $")
 #endif
 
 #include <assert.h>
@@ -572,11 +572,11 @@ cdf_read_short_sector_chain(const cdf_header_t *h,
 {
        size_t ss = CDF_SHORT_SEC_SIZE(h), i, j;
        scn->sst_tab = NULL;
-       scn->sst_len = cdf_count_chain(ssat, sid, ss);
+       scn->sst_len = cdf_count_chain(ssat, sid, CDF_SEC_SIZE(h));
        scn->sst_dirlen = len;
        scn->sst_ss = ss;
 
-       if (sst->sst_tab == NULL || scn->sst_len == (size_t)-1)
+       if (scn->sst_len == (size_t)-1)
                goto out;
 
        scn->sst_tab = calloc(scn->sst_len, ss);
@@ -683,7 +683,7 @@ cdf_read_ssat(const cdf_info_t *info, const cdf_header_t *h,
        cdf_secid_t sid = h->h_secid_first_sector_in_short_sat;
 
        ssat->sat_tab = NULL;
-       ssat->sat_len = cdf_count_chain(sat, sid, CDF_SEC_SIZE(h));
+       ssat->sat_len = cdf_count_chain(sat, sid, ss);
        if (ssat->sat_len == (size_t)-1)
                goto out;