Fixed bug when comparing ExtendedCapabilities_t structures
authorPierre-Anthony Lemieux <pal@palemieux.com>
Sat, 21 Dec 2019 06:05:59 +0000 (22:05 -0800)
committerPierre-Anthony Lemieux <pal@palemieux.com>
Sat, 21 Dec 2019 06:05:59 +0000 (22:05 -0800)
src/JP2K_Sequence_Parser.cpp

index e8d779c612aaf5900b3496627ffb290ee3ff6148..cb73edd10a58952eeaae44b3e8f10a26bcbea2e7 100755 (executable)
@@ -253,14 +253,18 @@ operator==(const ASDCP::JP2K::CodingStyleDefault_t& lhs, const ASDCP::JP2K::Codi
 bool
 operator==(const ASDCP::JP2K::ExtendedCapabilities_t& lhs, const ASDCP::JP2K::ExtendedCapabilities_t& rhs)
 {
-       if (lhs.Pcap != rhs.Pcap) return false;
-
        if (lhs.N != rhs.N) return false;
 
-       for (ui32_t i = 0; i < lhs.N; i++)
-       {
-               if (lhs.Ccap[i] != rhs.Ccap[i])
-                       return false;
+       if (lhs.N != JP2K::NoExtendedCapabilitiesSignaled) {
+
+               if (lhs.Pcap != rhs.Pcap) return false;
+
+               for (ui32_t i = 0; i < lhs.N; i++)
+               {
+                       if (lhs.Ccap[i] != rhs.Ccap[i])
+                               return false;
+               }
+
        }
 
        return true;