Fix crash when trying to verify an encrypted SMPTE subtitle asset. v1.8.67
authorCarl Hetherington <cth@carlh.net>
Thu, 20 Apr 2023 12:56:30 +0000 (14:56 +0200)
committerCarl Hetherington <cth@carlh.net>
Thu, 20 Apr 2023 12:56:30 +0000 (14:56 +0200)
src/verify.cc

index 6a1cbd2d3c0d3aa8f48d0d59f4d5f69b7419e5c5..b49695c7909567a89aaf8052c56e67fa71a4609c 100644 (file)
@@ -810,7 +810,8 @@ verify_subtitle_asset (
        if (smpte) {
                verify_smpte_timed_text_asset (smpte, reel_asset_duration, notes);
                verify_smpte_subtitle_asset (smpte, notes, state);
-               if (namespace_count(asset, "SubtitleReel") > 1) {
+               /* This asset may be encrypted and in that case we'll have no raw_xml() */
+               if (asset->raw_xml() && namespace_count(asset, "SubtitleReel") > 1) {
                        notes.push_back({ VerificationNote::Type::WARNING, VerificationNote::Code::INCORRECT_SUBTITLE_NAMESPACE_COUNT, asset->id()});
                }
        }