fwrite doesn't return the number of bytes written. check that fwrite is
authorBrandon Lewis <brandon@collabora.co.uk>
Fri, 16 Jul 2010 16:41:02 +0000 (18:41 +0200)
committerBrandon Lewis <brandon@collabora.co.uk>
Fri, 16 Jul 2010 16:54:49 +0000 (18:54 +0200)
non-zero and that ferror() isn't set instead.

ges/ges-timeline-pipeline.c

index d7cd704..6d7c141 100644 (file)
@@ -777,9 +777,9 @@ ges_timeline_pipeline_save_thumbnail (GESTimelinePipeline * self, int width, int
   }
 
   fp = fopen (location, "w+");
-  if (fwrite (GST_BUFFER_DATA (b), GST_BUFFER_SIZE (b), 1,
-          fp) != GST_BUFFER_SIZE (b))
+  if (!fwrite (GST_BUFFER_DATA (b), GST_BUFFER_SIZE (b), 1, fp) || ferror (fp)) {
     res = FALSE;
+  }
 
   fclose (fp);
   gst_caps_unref (caps);