Skip to content

Commit 4333da9

Browse files
committed
zstd
1 parent 336e3cd commit 4333da9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

thirdparty/gatb-core-stripped/src/gatb/bank/impl/BankFastaZstd.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,15 @@ inline bool rebuffer (buffered_file_t *bf)
455455
{
456456
if (bf->eof) return false;
457457
bf->buffer_start = 0;
458-
bf->stream->read(reinterpret_cast<char*>(bf->buffer), BUFFER_SIZE);
459-
bf->buffer_end = bf->stream->gcount();
458+
459+
try {
460+
bf->stream->read(reinterpret_cast<char*>(bf->buffer), BUFFER_SIZE);
461+
bf->buffer_end = bf->stream->gcount();
462+
} catch (const bxz::zstdException& ex) {
463+
bf->buffer_end = 0;
464+
std::cerr << bf->path << " " << ex.what() << std::endl;
465+
}
466+
460467
if (bf->buffer_end < BUFFER_SIZE) bf->eof = 1;
461468
if (bf->buffer_end == 0) return false;
462469
return true;

0 commit comments

Comments
 (0)