[Bug 702845] New: glshader element does not read shader file correctly

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Fri Jun 21 19:38:15 PDT 2013


https://bugzilla.gnome.org/show_bug.cgi?id=702845
  GStreamer | gst-plugins-gl | 0.10.3

           Summary: glshader element does not read shader file correctly
    Classification: Platform
           Product: GStreamer
           Version: 0.10.3
        OS/Version: Windows
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-gl
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: comicfans44 at gmail.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


in gstglfiltershader.c when reading shader file content, use incorrect variable
to determine file size, leads none shader file read. and here's a quick fix


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);

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list