Re: #14650: wxImage::Scale causes program crash when new size is too large

28 views
Skip to first unread message

wxTrac

unread,
Oct 4, 2012, 7:07:44 PM10/4/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14650#comment:3>

#14650: wxImage::Scale causes program crash when new size is too large
--------------------------------------------------------+-------------------
Reporter: Jive Dadson | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxMSW | Version: 2.9-svn
Keywords: Scale wxCHECK_MSG image.cpp GetData crash | Blockedby:
Patch: 0 | Blocking:
--------------------------------------------------------+-------------------

Comment(by catalin):

First of all I think this is another ticket for which there was no
notification sent by trac.

About the ticket - AFAICS the code does return an invalid image when an
operation fails. It also asserts which is not at all a "crash".
To disable asserts in release build, you can build wxW with DEBUG_FLAG=0
or see wxDisableAsserts() or the one you already discovered
wxSetAssertHandler(NULL).

About comment 2: when loading a corrupt image file you get a log window.
To disable it see [http://docs.wxwidgets.org/trunk/classwx_log_null.html
wxLogNull].

This is most likely not a bug after all.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14650#comment:3>

wxTrac

unread,
Oct 4, 2012, 7:23:07 PM10/4/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14650#comment:4>

#14650: wxImage::Scale causes program crash when new size is too large
--------------------------+-------------------------------------------------
Reporter: Jive Dadson | Owner:
Type: defect | Status: closed
Priority: normal | Milestone:
Component: wxMSW | Version: 2.9-svn
Resolution: invalid | Keywords: Scale wxCHECK_MSG image.cpp GetData crash
Blockedby: | Patch: 0
Blocking: |
--------------------------+-------------------------------------------------
Changes (by vadz):

* status: new => closed
* resolution: => invalid


Comment:

Replying to [comment:3 catalin]:
> First of all I think this is another ticket for which there was no
notification sent by trac.

Yes :-( I hope the OP already saw my comment in #14643:2 and changed his
login name to avoid this in the future.

> About the ticket - AFAICS the code does return an invalid image when an
operation fails. It also asserts which is not at all a "crash".

Absolutely.

> To disable asserts in release build, you can build wxW with DEBUG_FLAG=0
or see wxDisableAsserts() or the one you already discovered
wxSetAssertHandler(NULL).

And neither of those is necessary if you compile your release builds with
`NDEBUG` defined -- as you normally should.

> About comment 2: when loading a corrupt image file you get a log window.
To disable it see [http://docs.wxwidgets.org/trunk/classwx_log_null.html
wxLogNull].
>
> This is most likely not a bug after all.

No, not at all.

To the OP: if you have any questions about this, please post to wx-users.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14650#comment:4>
Reply all
Reply to author
Forward
0 new messages