Title: [268975] trunk/Source/WebCore
Revision
268975
Author
calva...@igalia.com
Date
2020-10-26 06:48:46 -0700 (Mon, 26 Oct 2020)

Log Message

[EME] Fix casts and sizes printing
https://bugs.webkit.org/show_bug.cgi?id=218171

Reviewed by Philippe Normand.

Fix size printing and casts in CDMThunder and ClearKey.

* platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp:
(WebCore::CDMProxyClearKey::cencDecryptSubsampled):
* platform/graphics/gstreamer/eme/CDMThunder.cpp:
(WebCore::ParsedResponseMessage::ParsedResponseMessage):
(WebCore::CDMInstanceSessionThunder::requestLicense):
(WebCore::CDMInstanceSessionThunder::updateLicense):
(WebCore::CDMInstanceSessionThunder::loadSession):
(WebCore::CDMInstanceSessionThunder::removeSessionData):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (268974 => 268975)


--- trunk/Source/WebCore/ChangeLog	2020-10-26 13:32:24 UTC (rev 268974)
+++ trunk/Source/WebCore/ChangeLog	2020-10-26 13:48:46 UTC (rev 268975)
@@ -1,3 +1,21 @@
+2020-10-26  Xabier Rodriguez Calvar  <calva...@igalia.com>
+
+        [EME] Fix casts and sizes printing
+        https://bugs.webkit.org/show_bug.cgi?id=218171
+
+        Reviewed by Philippe Normand.
+
+        Fix size printing and casts in CDMThunder and ClearKey.
+
+        * platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp:
+        (WebCore::CDMProxyClearKey::cencDecryptSubsampled):
+        * platform/graphics/gstreamer/eme/CDMThunder.cpp:
+        (WebCore::ParsedResponseMessage::ParsedResponseMessage):
+        (WebCore::CDMInstanceSessionThunder::requestLicense):
+        (WebCore::CDMInstanceSessionThunder::updateLicense):
+        (WebCore::CDMInstanceSessionThunder::loadSession):
+        (WebCore::CDMInstanceSessionThunder::removeSessionData):
+
 2020-10-26  Zalan Bujtas  <za...@apple.com>
 
         [LFC] Rename functions with ContentWidth/HeightAndMargin return type

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp (268974 => 268975)


--- trunk/Source/WebCore/platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp	2020-10-26 13:32:24 UTC (rev 268974)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp	2020-10-26 13:48:46 UTC (rev 268975)
@@ -184,12 +184,12 @@
         }
 
         // FIXME: These are high-frequency messages, not sure if there's a better logging lib in WebCore.
-        LOG(EME, "EME - subsample index %u - %u bytes clear (%lu bytes left to decrypt)", subsampleIndex, subsampleNumClearBytes, input.encryptedBufferSizeInBytes - encryptedBufferByteOffset);
+        LOG(EME, "EME - subsample index %u - %u bytes clear (%zu bytes left to decrypt)", subsampleIndex, subsampleNumClearBytes, input.encryptedBufferSizeInBytes - encryptedBufferByteOffset);
 
         encryptedBufferByteOffset += subsampleNumClearBytes;
 
         if (subsampleNumEncryptedBytes) {
-            LOG(EME, "EME - subsample index %u - %u bytes encrypted (%lu bytes left to decrypt)", subsampleIndex, subsampleNumEncryptedBytes, input.encryptedBufferSizeInBytes - encryptedBufferByteOffset);
+            LOG(EME, "EME - subsample index %u - %u bytes encrypted (%zu bytes left to decrypt)", subsampleIndex, subsampleNumEncryptedBytes, input.encryptedBufferSizeInBytes - encryptedBufferByteOffset);
 
             if (gcry_error_t cipherError = gcry_cipher_decrypt(gCryptHandle(), input.encryptedBuffer + encryptedBufferByteOffset, subsampleNumEncryptedBytes, 0, 0)) {
 #if !LOG_DISABLED

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp (268974 => 268975)


--- trunk/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp	2020-10-26 13:32:24 UTC (rev 268974)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp	2020-10-26 13:48:46 UTC (rev 268975)
@@ -314,7 +314,8 @@
             return;
 
         StringView payload(reinterpret_cast<const LChar*>(buffer->data()), buffer->size());
-        size_t typePosition = payload.find(":Type:");
+        StringView type(reinterpret_cast<const LChar*>(":Type:"), 6);
+        size_t typePosition = payload.find(type, 0);
         StringView requestType(payload.characters8(), typePosition != notFound ? typePosition : 0);
         unsigned offset = 0u;
         if (!requestType.isEmpty() && requestType.length() != payload.length())
@@ -463,7 +464,7 @@
     ASSERT(instance);
     m_initData = InitData(instance->keySystem(), WTFMove(initDataSharedBuffer));
 
-    GST_TRACE("Going to request a new session id, init data size %lu", m_initData.payload()->size());
+    GST_TRACE("Going to request a new session id, init data size %zu", m_initData.payload()->size());
     GST_MEMDUMP("init data", m_initData.payload()->dataAsUInt8Ptr(), m_initData.payload()->size());
 
     OpenCDMSession* session = nullptr;
@@ -529,13 +530,13 @@
                 ParsedResponseMessage parsedResponseMessage(responseMessage);
                 if (parsedResponseMessage.hasPayload()) {
                     Ref<SharedBuffer> message = WTFMove(parsedResponseMessage.payload());
-                    GST_DEBUG("got message of size %lu", message->size());
+                    GST_DEBUG("got message of size %zu", message->size());
                     GST_MEMDUMP("message", message->dataAsUInt8Ptr(), message->size());
                     callback(false, WTF::nullopt, WTF::nullopt,
                         std::make_pair(parsedResponseMessage.typeOr(MediaKeyMessageType::LicenseRequest),
                             WTFMove(message)), SuccessValue::Succeeded);
                 } else {
-                    GST_ERROR("message of size %lu incorrectly formatted", responseMessage ? responseMessage->size() : 0);
+                    GST_ERROR("message of size %zu incorrectly formatted", responseMessage ? responseMessage->size() : 0);
                     callback(false, WTF::nullopt, WTF::nullopt, WTF::nullopt, SuccessValue::Failed);
                 }
             }
@@ -563,12 +564,12 @@
                 ParsedResponseMessage parsedResponseMessage(responseMessage);
                 if (parsedResponseMessage.hasPayload()) {
                     Ref<SharedBuffer> message = WTFMove(parsedResponseMessage.payload());
-                    GST_DEBUG("got message of size %lu", message->size());
+                    GST_DEBUG("got message of size %zu", message->size());
                     GST_MEMDUMP("message", message->dataAsUInt8Ptr(), message->size());
                     callback(WTF::nullopt, WTF::nullopt, std::make_pair(parsedResponseMessage.typeOr(MediaKeyMessageType::LicenseRequest),
                         WTFMove(message)), SuccessValue::Succeeded, SessionLoadFailure::None);
                 } else {
-                    GST_ERROR("message of size %lu incorrectly formatted", responseMessage ? responseMessage->size() : 0);
+                    GST_ERROR("message of size %zu incorrectly formatted", responseMessage ? responseMessage->size() : 0);
                     callback(WTF::nullopt, WTF::nullopt, WTF::nullopt, SuccessValue::Failed, SessionLoadFailure::Other);
                 }
             }
@@ -609,10 +610,10 @@
                 ParsedResponseMessage parsedResponseMessage(buffer);
                 if (parsedResponseMessage.hasPayload()) {
                     Ref<SharedBuffer> message = WTFMove(parsedResponseMessage.payload());
-                    GST_DEBUG("session %s removed, message length %lu", m_sessionID.utf8().data(), message->size());
+                    GST_DEBUG("session %s removed, message length %zu", m_sessionID.utf8().data(), message->size());
                     callback(m_keyStore.allKeysAs(MediaKeyStatus::Released), WTFMove(message), SuccessValue::Succeeded);
                 } else {
-                    GST_WARNING("message of size %lu incorrectly formatted as session %s removal answer", buffer ? buffer->size() : 0,
+                    GST_WARNING("message of size %zu incorrectly formatted as session %s removal answer", buffer ? buffer->size() : 0,
                         m_sessionID.utf8().data());
                     callback(m_keyStore.allKeysAs(MediaKeyStatus::InternalError), WTF::nullopt, SuccessValue::Failed);
                 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to