[libgsf] ole: round-up the number of blocks
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [libgsf] ole: round-up the number of blocks
- Date: Sat, 23 Feb 2013 02:05:33 +0000 (UTC)
commit d17648283ad75bea3c8352c45478252e596456fe
Author: Marc-André Lureau <marcandre lureau gmail com>
Date:   Wed Dec 19 21:35:31 2012 +0100
    ole: round-up the number of blocks
    
    Some files are not multiple of block size, we may still want to seek to the last block
    
    https://bugzilla.gnome.org/show_bug.cgi?id=690524
 gsf/gsf-infile-msole.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gsf/gsf-infile-msole.c b/gsf/gsf-infile-msole.c
index 4488ad1..e290328 100644
--- a/gsf/gsf-infile-msole.c
+++ b/gsf/gsf-infile-msole.c
@@ -518,7 +518,7 @@ ole_init_info (GsfInfileMSOle *ole, GError **err)
        info->threshold      = GSF_LE_GET_GUINT32 (header + OLE_HEADER_THRESHOLD);
         info->sbat_start     = GSF_LE_GET_GUINT32 (header + OLE_HEADER_SBAT_START);
         info->num_sbat       = GSF_LE_GET_GUINT32 (header + OLE_HEADER_NUM_SBAT);
-       info->max_block      = (gsf_input_size (ole->input) - OLE_HEADER_SIZE) / info->bb.size;
+       info->max_block      = (gsf_input_size (ole->input) - OLE_HEADER_SIZE + info->bb.size -1) / 
info->bb.size;
        info->sb_file        = NULL;
 
        if (info->num_sbat == 0 &&
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]