[poppler] poppler/Annot.cc

Iñigo Martínez inigomartinez at gmail.com
Tue Jan 22 04:46:21 PST 2008


Oh, I found that bug in the summer too, and I rewrited the annotation
creation on Annots (to be clearer too). But I forgot that when I caught
the code again lately and didn't want to change too much the code.

I have a technical question too. The old code does use a prelocated
memory (a "cache") to store 16 annotations, and once that size is passed
it allocates space for another 16 annotations. In my code I did allocate
memory for every annotation (I suposse being this way slower).

If I'm correct, what size would be the recommended to cache the annots ?
Or am I missing something done in compilation time that doesn't do my
code slower ?

Bye,

El mar, 22-01-2008 a las 04:22 -0800, Carlos Garcia Campos escribió:
> poppler/Annot.cc |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> New commits:
> commit 547db8be1ab0b2987f0f06d8529eaaed2414028c
> Author: Carlos Garcia Campos <carlosgc at gnome.org>
> Date:   Tue Jan 22 13:22:20 2008 +0100
>
>     Fix a crash when createAnnot returns NULL due to invalid annot dict.
>
> diff --git a/poppler/Annot.cc b/poppler/Annot.cc
> index 45579cc..b23be2e 100644
> --- a/poppler/Annot.cc
> +++ b/poppler/Annot.cc
> @@ -2864,7 +2864,7 @@ Annots::Annots(XRef *xref, Catalog *catalog, Object *annotsObj) {
>        if (annotsObj->arrayGet(i, &obj1)->isDict()) {
>          annotsObj->arrayGetNF(i, &obj2);
>          annot = createAnnot (xref, acroForm, obj1.getDict(), catalog, &obj2);
> -        if (annot->isOk()) {
> +        if (annot && annot->isOk()) {
>            if (nAnnots >= size) {
>              size += 16;
>              annots = (Annot **)greallocn(annots, size, sizeof(Annot *));
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler


More information about the poppler mailing list