GNOME Bugzilla – Bug 702844
glshader element crash
Last modified: 2013-06-27 23:12:24 UTC
in file gstglfiltershader.c when loading shader file ,it should pass "r"(for fopen) instead of O_RDONLY (for open) ,this leads a crash when using glshader element. and here's a quick fix. --- a/gst/gl/gstglfiltershader.c 2012-05-08 12:43:19.000000000 +0800 +++ b/gst/gl/gstglfiltershader.c 2013-06-20 15:49:52.639081794 +0800 @@ -263,7 +263,7 @@ // read the filter from file GST_INFO ("loading file: %s", filename); - f = fopen (filename, O_RDONLY); + f = fopen (filename, "r"); if (f == NULL) { GST_ERROR ("could not open file: %s", filename); return -1;
Thanks, any chance you could tell us your name so we can attribute the patches to you properly?
王昕宇 or wangxinyu or comicfans44 ,any one is OK ,Thank you
Thanks, should be fixed by this as well (if not, please re-open): commit 8cbd495b5e71ef9a8604749e8c03190d6d314138 Author: Tim-Philipp Müller <tim@centricular.net> Date: Fri Jun 28 00:04:43 2013 +0100 glfiltershader: fix crash when loading shader file Just use g_file_get_contents() instead of home-made file loading. Fixes two issues - one is that we should pass "r" to fopen and not O_RDONLY, the other is that an incorrect variable was used to read the file length, leading to an empty shader file. Spotted by: Wang Xin-yu (王昕宇) <comicfans44@gmail.com> https://bugzilla.gnome.org/show_bug.cgi?id=702844 https://bugzilla.gnome.org/show_bug.cgi?id=702845 Conflicts: gst/gl/gstglfiltershader.c