<div dir="ltr">I was able to avoid a crash by adding a bytesPerLine argument, too... at least in the small test script. It didn't help in my larger application where I first ran into this issue. It's just one of those flaky sorts of memory corruption bugs where random things affect the behavior, which makes it even harder to debug :(</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 15, 2021 at 6:08 PM Baz Walter <<a href="mailto:bazwal@gmail.com">bazwal@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 15/10/2021 11:41, Phil Thompson wrote:<br>
> I can reproduce this on Linux but it works on macOS. The core dump is within the Qt code so I suspect it's a Qt bug.<br>
<br>
I can also reproduce this on Linux. However, if I refactor the example like this:<br>
<br>
data = b'\xff' * (256 * 256 * 4)<br>
<br>
img = QtGui.QImage(data, 256, 256, QtGui.QImage.Format.Format_ARGB32)<br>
<br>
there's no core dump and a valid image file is written.<br>
<br>
</blockquote></div>