Add missing null check in wxAffineMatrix2D::Get (PR #26303)

12 views
Skip to first unread message

Serdar Pehlivan

unread,
Mar 16, 2026, 4:51:43 PM (2 days ago) Mar 16
to wx-...@googlegroups.com, Subscribed

Variable "mat2D" wasn't being checked for null, despite "tr" was checked for it.


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26303

Commit Summary

  • 03627b3 Add missing null check in wxAffineMatrix2D::Get

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26303@github.com>

VZ

unread,
Mar 16, 2026, 5:04:09 PM (2 days ago) Mar 16
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26303)

This is consistent with the documentation, see interface/wx/affinematrix2dbase.h

    /**
        Get the component values of the matrix.

        @param mat2D
            The rotational components of the matrix (upper 2 x 2), must be
            non-null.
        @param tr
            The translational components of the matrix, may be @NULL.
    */
    virtual void Get(wxMatrix2D* mat2D, wxPoint2DDouble* tr) const = 0;

Crashing is still not very user-friendly, but AFAICS it makes no sense to call this function with null matrix (do you do it intentionally?), so we should probably add a wxCHECK_RET() to it, but not silently ignore the invalid calls.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26303/c4070583521@github.com>

Serdar Pehlivan

unread,
Mar 16, 2026, 6:04:19 PM (2 days ago) Mar 16
to wx-...@googlegroups.com, Subscribed
SerdarPe left a comment (wxWidgets/wxWidgets#26303)

It occured when I wanted to get just the translation part of the affine matrix. I didn't need the transformation matrix in that specific part of my code.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26303/c4070912771@github.com>

VZ

unread,
Mar 16, 2026, 8:18:46 PM (2 days ago) Mar 16
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26303)

OK, but then we need to update the documentation (under interface/wx) to not say that this parameter is required any longer, could you please do it?

And I'd still add at least a wxASSERT_MSG() checking that both of parameters are not null at the same time.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26303/c4071472548@github.com>

Serdar Pehlivan

unread,
Mar 17, 2026, 6:21:11 AM (20 hours ago) Mar 17
to wx-...@googlegroups.com, Push

@SerdarPe pushed 1 commit.

  • ec2d139 Update documentation for wxAffineMatrix2D::Get


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26303/before/03627b3c21e90e21918f9dc7c97d5b6fab52ed38/after/ec2d1399a63b8881878f8d0fb0ccf4e0d217dac7@github.com>

Serdar Pehlivan

unread,
Mar 17, 2026, 6:27:29 AM (20 hours ago) Mar 17
to wx-...@googlegroups.com, Push

@SerdarPe pushed 1 commit.

  • 2b1929b Update documentation for wxAffineMatrix2D::Get


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26303/before/ec2d1399a63b8881878f8d0fb0ccf4e0d217dac7/after/2b1929b30646a43675c8d004c3c1c2452775ba32@github.com>

Serdar Pehlivan

unread,
Mar 17, 2026, 7:16:48 AM (19 hours ago) Mar 17
to wx-...@googlegroups.com, Push

@SerdarPe pushed 1 commit.

  • bceefa8 Add missing null check in wxAffineMatrix2D::Get


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26303/before/2b1929b30646a43675c8d004c3c1c2452775ba32/after/bceefa87e5e077d8159e4a9705f5aca825fdfdc3@github.com>

Serdar Pehlivan

unread,
Mar 17, 2026, 7:32:04 AM (19 hours ago) Mar 17
to wx-...@googlegroups.com, Subscribed
SerdarPe left a comment (wxWidgets/wxWidgets#26303)

Alright, I've updated the commit.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26303/c4074304467@github.com>

VZ

unread,
Mar 17, 2026, 9:11:33 AM (17 hours ago) Mar 17
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26303)

Thanks, will merge soon.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26303/c4074848870@github.com>

VZ

unread,
Mar 17, 2026, 9:22:06 AM (17 hours ago) Mar 17
to wx-...@googlegroups.com, Subscribed

Closed #26303 via 1ac87c6.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26303/issue_event/23643770419@github.com>

Reply all
Reply to author
Forward
0 new messages