summaryrefslogtreecommitdiff
path: root/test/testshape.c
diff options
context:
space:
mode:
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>2017-06-02 22:15:23 +0200
committerPhilipp Wiesemann <philipp.wiesemann@arcor.de>2017-06-02 22:15:23 +0200
commitf8dc17bacd50938d58b2a65614f0370b4ee331af (patch)
tree7073ed574d8acaeebd5aeea82a64e99b1e05c0c6 /test/testshape.c
parenta4aa084df6c297c2c44797b94bcc3a63d604c774 (diff)
Fixed crash if creating textures failed in testshape program.
Diffstat (limited to 'test/testshape.c')
-rw-r--r--test/testshape.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/test/testshape.c b/test/testshape.c
index c194fcb9c5..77df8b58cd 100644
--- a/test/testshape.c
+++ b/test/testshape.c
@@ -81,7 +81,6 @@ int main(int argc,char** argv)
pictures[i].surface = SDL_LoadBMP(argv[i+1]);
pictures[i].name = argv[i+1];
if(pictures[i].surface == NULL) {
- j = 0;
for(j=0;j<num_pictures;j++)
SDL_FreeSurface(pictures[j].surface);
SDL_free(pictures);
@@ -130,8 +129,7 @@ int main(int argc,char** argv)
for(i=0;i<num_pictures;i++) {
pictures[i].texture = SDL_CreateTextureFromSurface(renderer,pictures[i].surface);
if(pictures[i].texture == NULL) {
- j = 0;
- for(j=0;j<num_pictures;i++)
+ for(i=0;i<num_pictures;i++)
if(pictures[i].texture != NULL)
SDL_DestroyTexture(pictures[i].texture);
for(i=0;i<num_pictures;i++)