Hi Pino<br><br> I am sorry to say about my previous patch. Thank you for your patience suggestions. This time I sent a new patch with all those changes. instead of filename i gave fsName (filespecName). Some how I miss that delete(filename) which included in the patch, yes you are correct we don't have to delete this otherwise it won't set it.<br>
<br>Thanks<br>--<br>A Srinivas<br><br><div class="gmail_quote">On Thu, Apr 7, 2011 at 12:30 AM, <span dir="ltr"><<a href="mailto:poppler-request@lists.freedesktop.org">poppler-request@lists.freedesktop.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Send poppler mailing list submissions to<br>
<a href="mailto:poppler@lists.freedesktop.org">poppler@lists.freedesktop.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="http://lists.freedesktop.org/mailman/listinfo/poppler" target="_blank">http://lists.freedesktop.org/mailman/listinfo/poppler</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:poppler-request@lists.freedesktop.org">poppler-request@lists.freedesktop.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:poppler-owner@lists.freedesktop.org">poppler-owner@lists.freedesktop.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of poppler digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: Patch: New additions in FileSpec (Pino Toscano)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Wed, 6 Apr 2011 12:28:26 +0200<br>
From: Pino Toscano <<a href="mailto:pino@kde.org">pino@kde.org</a>><br>
Subject: Re: [poppler] Patch: New additions in FileSpec<br>
To: <a href="mailto:poppler@lists.freedesktop.org">poppler@lists.freedesktop.org</a><br>
Message-ID: <<a href="mailto:201104061228.26995.pino@kde.org">201104061228.26995.pino@kde.org</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hi,<br>
<br>
Alle mercoled? 6 aprile 2011, srinivas adicherla ha scritto:<br>
> For i/o checks for fseek() and ftell(),<br>
> here we don't have to check for 10 bytes.<br>
<br>
The point is: I/O can fail, and you have to check for it.<br>
<br>
> +static GBool getFileSpecObject(XRef *xref, Stream *stream, const<br>
> char* fileName, Object *obj)<br>
> +{<br>
> + Object fileSpec, obj1, obj2;<br>
> + int length;<br>
> +<br>
> + GooString *filename = new GooString(fileName);<br>
<br>
Please give it a slightly different name, otherwise it is easy to<br>
misread filename and fileName.<br>
<br>
> + char *fileNameUTF16 = pdfDocEncodingToUTF16(filename, &length);<br>
> +<br>
> + fileSpec.initDict(xref);<br>
> + fileSpec.dictSet("Type", obj1.initName("Filespec"));<br>
> + fileSpec.dictSet("F", obj1.initString(filename));<br>
> + fileSpec.dictSet("UF", obj1.initString(new<br>
> GooString(fileNameUTF16, length)));<br>
> +<br>
> + delete []fileNameUTF16;<br>
> + delete(filename);<br>
<br>
no, obj1.initString(filename) already takes ownership of filename, so<br>
you don't delete it.<br>
<br>
> +GBool createFilespec (XRef *xref, GooString *filePathA, Object *obj)<br>
<br>
"FileSpec", not "Filespec"<br>
<br>
> +{<br>
> [...]<br>
> + if (!(size = ftell(fs)))<br>
> + return gFalse;<br>
<br>
no, any return value >= 0 means success, while -1 means error.<br>
also, you miss the error() call for ftell() failure<br>
<br>
> + // Extract the video name from the file uri<br>
<br>
again video name?!<br>
<br>
srinivas, let's be frank now: do you ever *read* your patches, or you<br>
just do some partially untested changes, rediff and send?<br>
<br>
--<br>
Pino Toscano<br>
-------------- next part --------------<br>
A non-text attachment was scrubbed...<br>
Name: not available<br>
Type: application/pgp-signature<br>
Size: 190 bytes<br>
Desc: This is a digitally signed message part.<br>
URL: <<a href="http://lists.freedesktop.org/archives/poppler/attachments/20110406/fb1a817d/attachment-0001.pgp" target="_blank">http://lists.freedesktop.org/archives/poppler/attachments/20110406/fb1a817d/attachment-0001.pgp</a>><br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
poppler mailing list<br>
<a href="mailto:poppler@lists.freedesktop.org">poppler@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/poppler" target="_blank">http://lists.freedesktop.org/mailman/listinfo/poppler</a><br>
<br>
<br>
End of poppler Digest, Vol 74, Issue 11<br>
***************************************<br>
</blockquote></div><br>