Fix a couple more crashes with incorrect KDMs (#1000).
authorCarl Hetherington <cth@carlh.net>
Mon, 8 Jan 2018 23:14:28 +0000 (23:14 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 8 Jan 2018 23:14:28 +0000 (23:14 +0000)
src/lib/dcp_content.cc

index 43d6911f57412d2f412623e36365fdaacad51f3b..a6424874adb6978d488693c542fb4122d0206da6 100644 (file)
@@ -456,6 +456,9 @@ DCPContent::can_reference (function<shared_ptr<ContentPart> (shared_ptr<const Co
        } catch (dcp::DCPReadError) {
                /* We couldn't read the DCP; it's probably missing */
                return false;
+       } catch (dcp::KDMDecryptionError) {
+               /* We have an incorrect KDM */
+               return false;
        }
 
        /* fr must contain reels().  It can also contain other reels, but it must at
@@ -497,6 +500,9 @@ DCPContent::can_reference_audio (list<string>& why_not) const
        } catch (dcp::DCPReadError) {
                /* We couldn't read the DCP, so it's probably missing */
                return false;
+       } catch (dcp::KDMDecryptionError) {
+               /* We have an incorrect KDM */
+               return false;
        }
 
         BOOST_FOREACH (shared_ptr<dcp::Reel> i, decoder->reels()) {
@@ -518,6 +524,9 @@ DCPContent::can_reference_subtitle (list<string>& why_not) const
        } catch (dcp::DCPReadError) {
                /* We couldn't read the DCP, so it's probably missing */
                return false;
+       } catch (dcp::KDMDecryptionError) {
+               /* We have an incorrect KDM */
+               return false;
        }
 
         BOOST_FOREACH (shared_ptr<dcp::Reel> i, decoder->reels()) {