[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#642055: daisy-player: reports "corrupt daisy structure" and aborts while reading valid book



I haven't solved this entirely, but I've made progress.

It turned out that the XML/XHTML attributes in the input file were not being
parsed properly. I think the following patch fixes it. However, this exposes
another bug: the Daisy book is now parsed, but I get this error:

clip_end (959.366000) is smaller than clip_begin (1160.734000).
This is not possible!
Daisy-player can't handle this DTB.

Here's my patch so far.


commit a7d81ada5baeeca158eef45ce2c7da6b21cba6ff
Author: Jason White <jason@jasonjgw.net>
Date:   Mon Sep 19 18:31:53 2011 +1000

    Work on attribute parsing bug.

diff --git a/daisy-player.c b/daisy-player.c
index 2ba53aa..85a83d3 100644
--- a/daisy-player.c
+++ b/daisy-player.c
@@ -395,6 +395,7 @@ void get_attributes (char *p)
         break;
       strncpy (name, p, 250);
       p = name;
+      begin = p;
       while (! isspace (*p) && *p != '=')
       {
          if (*p == '>' || *p == '?')
@@ -434,6 +435,7 @@ void get_attributes (char *p)
 
       value = p;
       p = value;
+      begin = p;
       while (*p != '"' && *p != '>' && *p != '?')
       {
          if (p - begin > 250)




Reply to: