Fix checking for existing key_id; _key_id would always be set because MXF::set_key...
authorCarl Hetherington <cth@carlh.net>
Mon, 20 Nov 2023 20:05:11 +0000 (21:05 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 20 Nov 2023 20:05:11 +0000 (21:05 +0100)
src/smpte_subtitle_asset.cc

index ea1d74269da2184c456d1c01f6b5b6c6423f6566..c1138f23c04e83a51cff52bb195ad0a51c2e458d 100644 (file)
@@ -306,10 +306,11 @@ SMPTESubtitleAsset::set_key (Key key)
           have read that file.
        */
        auto const had_key = static_cast<bool>(_key);
+       auto const had_key_id = static_cast<bool>(_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.