# HG changeset patch # User Sam Lantinga # Date 1297010808 28800 # Node ID 7d64745f136344623144f30a35953590ead4b0e0 # Parent af7caea67886f8e8444e1fd4d3a8efedeffd806a Fixed crash when binary shaders are not available. diff -r af7caea67886 -r 7d64745f1363 src/render/opengles2/SDL_render_gles2.c --- a/src/render/opengles2/SDL_render_gles2.c Sun Feb 06 02:41:32 2011 -0800 +++ b/src/render/opengles2/SDL_render_gles2.c Sun Feb 06 08:46:48 2011 -0800 @@ -558,16 +558,17 @@ } /* Find a matching shader instance that's supported on this hardware */ - for (i = 0; i < shader->instance_count; ++i) + for (i = 0; i < shader->instance_count && !instance; ++i) { - for (j = 0; j < rdata->shader_format_count; ++j) + for (j = 0; j < rdata->shader_format_count && !instance; ++j) { if (!shader->instances) continue; + if (!shader->instances[i]) + continue; if (shader->instances[i]->format != rdata->shader_formats[j]) continue; instance = shader->instances[i]; - break; } } if (!instance)