fwrite doesn't return the number of bytes written. check that fwrite is

non-zero and that ferror() isn't set instead.
This commit is contained in:
Brandon Lewis 2010-07-16 18:41:02 +02:00
parent de54e7a312
commit 295d177d12

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