Bug 24733

Summary: Incorrect movie size types
Product: poppler Reporter: Ilya Gorenbein <igorenbein>
Component: generalAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch to the problem
Cast to integer patch

Description Ilya Gorenbein 2009-10-26 06:12:17 UTC
Created attachment 30694 [details] [review]
Patch to the problem

Hello,

I am using version 0.12.0. 
Due to absence of isInt() check, poppler crashes at Annot.cc 

          width = aspect->get(0, &tmp)->getInt(); (line 3542)

          and

          height = aspect->get(1, &tmp)->getInt();  (line 3544)

Moreover, thе attached file (link to it http://www.hinduismtoday.com/archives/2006/1-3/pdf/section-4_2006-01-01_p68-69.pdf) does not contains integers at width/height array. It contains doubles. I think that we should change it to getNum() instead of getInt(). This leads us to do more changes over the project, such as change of QSize to QSizeF. Patch is attached.

Regards,
Ilya Gorenbein
Comment 1 Albert Astals Cid 2009-10-27 13:07:55 UTC
Having a look at the specification it says the height and width are pixels, i see little reason to support decimal pixel sizes, so what about accepting reals but rounding them inside Annot code?
Comment 2 Ilya Gorenbein 2009-10-28 01:13:49 UTC
Created attachment 30762 [details] [review]
Cast to integer patch
Comment 3 Ilya Gorenbein 2009-10-28 01:15:48 UTC
I did the patch (to double) keeping in mind that we do not want to loose the data. Maybe in the future it will be useful.
Patch according to suggested by you solution (to int) is attached.
Comment 4 Albert Astals Cid 2009-10-28 11:23:03 UTC
Commited, thanks for the patch

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.