Mercurial > mplayer.hg
changeset 29570:eb2567b65311
Check setGlWindow return value to fail properly instead of crashing if e.g.
no OpenGL support is available.
author | reimar |
---|---|
date | Tue, 01 Sep 2009 15:20:05 +0000 |
parents | 3e13839031b3 |
children | 94524110f645 |
files | libvo/vo_gl.c libvo/vo_gl2.c |
diffstat | 2 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/libvo/vo_gl.c Tue Sep 01 15:00:49 2009 +0000 +++ b/libvo/vo_gl.c Tue Sep 01 15:20:05 2009 +0000 @@ -571,7 +571,8 @@ glconfig: if (vo_config_count) uninitGl(); - setGlWindow(&gl_vinfo, &gl_context, vo_window); + if (setGlWindow(&gl_vinfo, &gl_context, vo_window) == SET_WINDOW_FAILED) + return -1; initGl(vo_dwidth, vo_dheight); return 0;
--- a/libvo/vo_gl2.c Tue Sep 01 15:00:49 2009 +0000 +++ b/libvo/vo_gl2.c Tue Sep 01 15:20:05 2009 +0000 @@ -637,7 +637,8 @@ #endif return -1; - setGlWindow(&gl_vinfo, &gl_context, vo_window); + if (setGlWindow(&gl_vinfo, &gl_context, vo_window) == SET_WINDOW_FAILED) + return -1; glVersion = glGetString(GL_VERSION);