rosbag::ChunkedFile::swap segfault if the ChunkedFile is default-constructed, because it tries to write to read_stream_->file_ while read_stream_ is null.
This causes rosbag::Bag to segfault as well when using std::swap, for instance when adding rosbags to a growing vector.
rosbag::ChunkedFile::swap
segfault if the ChunkedFile is default-constructed, because it tries to write toread_stream_->file_
whileread_stream_
is null.This causes
rosbag::Bag
to segfault as well when usingstd::swap
, for instance when adding rosbags to a growing vector.This code triggers the segfault: