display_png crashes display with bad file path #825
Comments
|
So here's a possible solution.
FWIW - it appears the surface created will still be a valid pointer, but it will return a pointer to a "nil" surface for an error like file not found. I don't understand if that "nil" pointer actually == NULL though. Also - What I'm not sure about - does the surface need to be destroyed before |
|
@okyeron did your solution work? please PR if so! |
|
I'll need to revisit this and refresh my memory. Will see if I can get a PR together shortly. Again - was looking for feedback here about: " does the surface need to be destroyed before return;? (Or the filename pointer free'd?)" |
|
not sure if the image needs to be destroyed. perhaps try a sizeof and see if memory was allocated? |
|
if file not found, PR sent. Fix prints an error on file not found, does not crash. |
Using
display_pngwith a path to a non-existent file looks like it crashes the display in some fashion (screen goes black, no other script will show anything) .;restartbrings things back to normal.Suggestions on debug?
The text was updated successfully, but these errors were encountered: