From: Carl Hetherington Date: Mon, 20 Nov 2023 20:05:11 +0000 (+0100) Subject: Fix checking for existing key_id; _key_id would always be set because MXF::set_key... X-Git-Tag: v1.8.88~1 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=bb8cf4610af37d4f89555f96990ef1b9c7d58acd;hp=f7334e538f39aadf3bab42244c26124a995234f7;p=libdcp.git Fix checking for existing key_id; _key_id would always be set because MXF::set_key() sets it. --- diff --git a/src/smpte_subtitle_asset.cc b/src/smpte_subtitle_asset.cc index ea1d7426..c1138f23 100644 --- a/src/smpte_subtitle_asset.cc +++ b/src/smpte_subtitle_asset.cc @@ -306,10 +306,11 @@ SMPTESubtitleAsset::set_key (Key key) have read that file. */ auto const had_key = static_cast(_key); + auto const had_key_id = static_cast(_key_id); MXF::set_key (key); - if (!_key_id || !_file || had_key) { + if (!had_key_id || !_file || had_key) { /* Either we don't have any data to read, it wasn't encrypted, or we've already read it, so we don't need to do anything else.