]> granicus.if.org Git - taglib/commit
Call fflush() before ftruncate() to drop all buffered data (#914)
authorwhatdoineed2do <whatdoineed2do@gmail.com>
Thu, 25 Jul 2019 02:57:49 +0000 (03:57 +0100)
committerStephen F. Booth <me@sbooth.org>
Thu, 25 Jul 2019 02:57:49 +0000 (07:27 +0430)
commit79bc9ccf8ea5606da2a86e1bfb5439e73a146272
tree80cfb9b03d2ad747c4263f561ca858051d2adbf6
parentba7adc2bc261ed634c2a964185bcffb9365ad2f4
Call fflush() before ftruncate() to drop all buffered data (#914)

This avoids stale data presented to caller via a fread()

Current bug due to the buffered data can be seen in stripping mp3s of tags

    f.strip(ID3v1);
    f.strip(APE);

The ID3v1 tag sits at the end of file (strip calls ftruncate()) and the APE
strip performs a readFile() that would return the stream buffered/truncated data
and reinsert
taglib/toolkit/tfilestream.cpp