Opened 16 years ago
Closed 16 years ago
#5179 closed defect (fixed)
QImage takes an int for the number of colors (which means it can only take 2 Mi colors)
Reported by: | Owned by: | stuartm | |
---|---|---|---|
Priority: | trivial | Milestone: | 0.22 |
Component: | mythtv | Version: | head |
Severity: | low | Keywords: | |
Cc: | Ticket locked: | no |
Description
QImage takes a parameter in its constructor that specifies the number of colors the image can have. That parameter type is an int. Which can only go to 2 Mibi colors. In a few places where QImages are used they are given 4 Mibi colors. Which is an integer overflow value to a constructor. Probably nothing bad is happening. But it is likely better to give the integer max instead of an overflow value.
Attachments (2)
Change History (6)
Changed 16 years ago by
Attachment: | libs_libmyhtv-integer-overflow-in-QImage.patch added |
---|
comment:1 Changed 16 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Since this particular constructor doesn't exist in QT4 the correct fix will be applied as part of the QT4 port. In QT4 we use a format enum value instead to specify the colour depth. e.g QImage::Format_RGB32
comment:2 Changed 16 years ago by
Resolution: | invalid |
---|---|
Status: | closed → new |
OK, so the port has happened and this constructor has not changed. So I am reopening the ticket and submitting a patch that uses the QT4 enum based constructor as Stuart mentions.
Changed 16 years ago by
Attachment: | libs_libmythtv-integer-overflow-in-QImage-ticket-5179.patch added |
---|
Same patch, but uses the QT4 ctor and enum
comment:3 Changed 16 years ago by
Milestone: | unknown → 0.22 |
---|---|
Owner: | changed from Isaac Richards to stuartm |
Status: | new → assigned |
The QT4 port is far from complete. We've converted to QT4 + QT3Support and we're now slowly moving towards full QT4 which would include replacing QT3 only classes/methods with QT4 equivalents.
Thanks for the patch however :)
comment:4 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
changes the 4Mibi value in the ctor call to the INT_MAX macro from the C library