diff options
Diffstat (limited to 'gst/qtmux/atomsrecovery.c')
-rw-r--r-- | gst/qtmux/atomsrecovery.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gst/qtmux/atomsrecovery.c b/gst/qtmux/atomsrecovery.c index 9e1ba6798..907683e43 100644 --- a/gst/qtmux/atomsrecovery.c +++ b/gst/qtmux/atomsrecovery.c @@ -1070,8 +1070,16 @@ moov_recov_write_file (MoovRecovFile * moovrf, MdatRecovFile * mdatrf, data = g_malloc (4096); while (!feof (mdatrf->file)) { - gint read = fread (data, 1, 4096, mdatrf->file); - fwrite (data, 1, read, outf); + gint read, write; + + read = fread (data, 1, 4096, mdatrf->file); + write = fwrite (data, 1, read, outf); + + if (write != read) { + g_set_error (err, ATOMS_RECOV_QUARK, ATOMS_RECOV_ERR_FILE, + "Failed to copy data to output file: %s", g_strerror (errno)); + goto fail; + } } g_free (data); |