GNOME Bugzilla – Bug 721351
Truncates Ogg files files with multiple links when saving tags
Last modified: 2014-03-19 07:41:01 UTC
To reproduce, make an extra hardlink of any .ogg file, edit the tags and filename (i didn't try which operation does it) in easytag and save the file, marvel at the lost data. The resulting files have all the tags but are about 6-8kB and contain no audio data.
I can reproduce this in master: 1. created a hard link to an Ogg file 2. opened the directory containing both files in EasyTAG 3. edited the tags of one of the files, and saved the changes Renaming works fine, but saving the tags causes the file to be truncated.
Created attachment 272244 [details] [review] This patch will first write data to GMemoryOutputStream and then to file.
Review of attachment 272244 [details] [review]: Looks fine, just a couple of leaks. I have not run Valgrind with your patch applied, so it would be a good idea to do that before resubmitting. ::: src/vcedit.c @@ +797,2 @@ if (error == NULL || *error != NULL) return FALSE; As you moved the g_object_unref() further down, you need to also unref before returning here. @@ +817,3 @@ + g_object_unref (ostream); + g_assert (error == NULL || *error != NULL); + return FALSE; You also need to free "buf" here.
Created attachment 272260 [details] [review] This patch will first write data to GMemoryOutputStream and then to file. Fixed two leaks. I did run valgrind and I didn't find any memory leak related to vcedit_write.
Comment on attachment 272260 [details] [review] This patch will first write data to GMemoryOutputStream and then to file. I pushed a slightly-reformatted version of the patch to master as commit a27a8fe8cbd12dac86f0e615fbda068f8bdd4a10.