aboutsummaryrefslogtreecommitdiff
path: root/loader.c
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2015-11-06 10:55:47 +0000
committerHarry Jeffery <harry@exec64.co.uk>2015-11-06 10:55:47 +0000
commit0ceb3c4fc1bd4999fcde1aaeb81f7e9bf847d032 (patch)
tree46735aa5f008bfc44274b178b954ec2865da5ef9 /loader.c
parenta7bc52c529f50f21f56485dd942889d947676156 (diff)
downloadimv-0ceb3c4fc1bd4999fcde1aaeb81f7e9bf847d032.tar.gz
Discard invalid paths
Diffstat (limited to 'loader.c')
-rw-r--r--loader.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/loader.c b/loader.c
index 99d2838..3615908 100644
--- a/loader.c
+++ b/loader.c
@@ -11,6 +11,9 @@ SDL_Texture* imv_load_image(SDL_Renderer *r, const char* path)
const char* ext = strrchr(path, '.');
+ if(!ext)
+ return NULL;
+
if(strcasecmp(ext, ".png") == 0) {
return imv_load_png(r, path);
} else if(strcasecmp(ext, ".jpeg") == 0 || strcasecmp(ext, ".jpg") == 0) {