<div dir="ltr">plus , I also found a small bug in following shader load code:<br><br>fseek does not return file size, ftell does<br><br>--- a/gst/gl/gstglfiltershader.c 2013-06-20 15:59:21.095105994 +0800<br>+++ b/gst/gl/gstglfiltershader.c 2013-06-20 17:03:45.969051269 +0800<br>
@@ -259,6 +259,7 @@<br> <br> size_t count;<br> size_t bytes;<br>+ int seek_result;<br> FILE *f;<br> <br> // read the filter from file<br>@@ -274,7 +275,21 @@<br> *storage = 0;<br> }<br> <br>- count = fseek (f, 0, SEEK_END);<br>
+ seek_result = fseek (f, 0, SEEK_END);<br>+<br>+ if (seek_result != 0){<br>+ GST_ERROR ("could not seek file: %s", filename);<br>+ return -1;<br>+ }<br>+<br>+ count = ftell (f);<br>+<br>+ if (count == -1){<br>
+ GST_ERROR ("could not seek file: %s", filename);<br>+ return -1;<br>+ }<br>+<br>+<br> *storage = g_malloc (count + 1);<br> if (!*storage) {<br> GST_ERROR ("g_malloc failed: %lud", (gulong) count);<br>
</div>