gst-plugins-gl 0.10.3 glshader element bug

comic fans comicfans44 at gmail.com
Thu Jun 20 02:16:18 PDT 2013


plus , I also found a small bug in following shader load code:

fseek does not return file size, ftell does

--- a/gst/gl/gstglfiltershader.c        2013-06-20 15:59:21.095105994 +0800
+++ b/gst/gl/gstglfiltershader.c        2013-06-20 17:03:45.969051269 +0800
@@ -259,6 +259,7 @@

   size_t count;
   size_t bytes;
+  int seek_result;
   FILE *f;

   // read the filter from file
@@ -274,7 +275,21 @@
     *storage = 0;
   }

-  count = fseek (f, 0, SEEK_END);
+  seek_result = fseek (f, 0, SEEK_END);
+
+  if (seek_result != 0){
+    GST_ERROR ("could not seek file: %s", filename);
+    return -1;
+  }
+
+  count = ftell (f);
+
+  if (count == -1){
+    GST_ERROR ("could not seek file: %s", filename);
+    return -1;
+  }
+
+
   *storage = g_malloc (count + 1);
   if (!*storage) {
     GST_ERROR ("g_malloc failed: %lud", (gulong) count);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130620/9bf257f6/attachment.html>


More information about the gstreamer-devel mailing list