diff options
author | Tor Andersson <tor@ghostscript.com> | 2008-06-30 20:56:23 +0200 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2008-06-30 20:56:23 +0200 |
commit | fa526ed269a795c099d8d906c36a53ebadb6560b (patch) | |
tree | 8b3918d8f533b07f5b9e68314f0a30650430f158 | |
parent | 527bb313767f5675001b99f956cac45aea81b90e (diff) | |
download | mupdf-fa526ed269a795c099d8d906c36a53ebadb6560b.tar.xz |
Don't sort empty cmaps.
-rw-r--r-- | mupdf/pdf_cmap.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mupdf/pdf_cmap.c b/mupdf/pdf_cmap.c index 6cf351d7..b58320be 100644 --- a/mupdf/pdf_cmap.c +++ b/mupdf/pdf_cmap.c @@ -370,6 +370,9 @@ pdf_sortcmap(pdf_cmap *cmap) pdf_range *a; /* last written range on output */ pdf_range *b; /* current range examined on input */ + if (cmap->rlen == 0) + return fz_okay; + qsort(cmap->ranges, cmap->rlen, sizeof(pdf_range), cmprange); a = cmap->ranges; @@ -466,8 +469,6 @@ pdf_sortcmap(pdf_cmap *cmap) cmap->rlen = a - cmap->ranges + 1; - assert(cmap->rlen > 0); - newranges = fz_realloc(cmap->ranges, cmap->rlen * sizeof(pdf_range)); if (!newranges) return fz_throw("outofmem: cmap ranges"); |