Skip to content

Commit

Permalink
Fixed|libdeng2|ArchiveFeed: Handling corrupt source data
Browse files Browse the repository at this point in the history
Even if the source archive was invalid and caused an exception when
reading, the feed was still added to the source file's deletion
audience. However, the exception caused the ArchiveFeed constructor
to be automatically undone, leaving an invalid pointer in the source
file's audience.
  • Loading branch information
skyjake committed Mar 25, 2014
1 parent 67270a6 commit cff42b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doomsday/libdeng2/src/filesys/archivefeed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ DENG2_PIMPL(ArchiveFeed)

Instance(Public *feed, File &f) : Base(feed), file(&f), arch(0), parentFeed(0)
{
file->audienceForDeletion() += this;

// If the file happens to be a byte array file, we can use it
// directly to store the Archive.
if(IByteArray *bytes = f.maybeAs<IByteArray>())
Expand All @@ -67,6 +65,8 @@ DENG2_PIMPL(ArchiveFeed)
f >> serializedArchive;
arch = new ZipArchive(serializedArchive);
}

file->audienceForDeletion() += this;
}

Instance(Public *feed, ArchiveFeed &parentFeed, String const &path)
Expand Down

0 comments on commit cff42b4

Please sign in to comment.