coronalabs / corona

Solar2D Game Engine main repository (ex Corona SDK)
https://solar2d.com/
MIT License
2.54k stars 273 forks source link

Fix: Loading an invalid image causes a crash #678

Open aoyako opened 9 months ago

aoyako commented 9 months ago

Platform: Linux Fix the issue when Solar crashes with a segmentation fault on loading an invalid image file (.png, .jpg, .bmp).

Steps to reproduce:

  1. Create an empty file with the extension .png (empty.png)
  2. Put the following line in the new project's main.lua local background = display.newImageRect("empty.png", 600, 600)

Expected behavior:

Runtime Error is reported.

Actual behavior:

Solar crashed, leaving a log

libpng error: Read Error
Segmentation fault
CLAassistant commented 9 months ago

CLA assistant check
All committers have signed the CLA.