From 5934b82edae1e3026b539c9e21946efca1ce1ae1 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Fri, 3 Dec 2021 09:08:02 -0600 Subject: [PATCH] media-converter: Don't panic on unknown tags for read-only DBs CW-Bug-Id: #19516 --- media-converter/src/fossilize.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/media-converter/src/fossilize.rs b/media-converter/src/fossilize.rs index 79248ba1..b2b4a9d4 100644 --- a/media-converter/src/fossilize.rs +++ b/media-converter/src/fossilize.rs @@ -272,6 +272,11 @@ impl StreamArchive { match res { Ok(p) => { self.write_pos = p; + if tag >= self.seen_blobs.len() && + self.file.metadata()?.permissions().readonly() { + /* ignore unknown tags for read-only DBs, otherwise panic */ + continue; + } self.seen_blobs[tag].insert(hash, payload_entry); },