From 295d177d12a456cf4ad560fd6edbf4d6c2554232 Mon Sep 17 00:00:00 2001 From: Brandon Lewis Date: Fri, 16 Jul 2010 18:41:02 +0200 Subject: [PATCH] fwrite doesn't return the number of bytes written. check that fwrite is non-zero and that ferror() isn't set instead. --- ges/ges-timeline-pipeline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ges/ges-timeline-pipeline.c b/ges/ges-timeline-pipeline.c index d7cd704cf7..6d7c141495 100644 --- a/ges/ges-timeline-pipeline.c +++ b/ges/ges-timeline-pipeline.c @@ -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);