⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 268975 in webkit


Ignore:
Timestamp:
Oct 26, 2020, 6:48:46 AM (6 years ago)
Author:
calvaris@igalia.com
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):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r268974 r268975  
     12020-10-26  Xabier Rodriguez Calvar  <calvaris@igalia.com>
     2
     3        [EME] Fix casts and sizes printing
     4        https://bugs.webkit.org/show_bug.cgi?id=218171
     5
     6        Reviewed by Philippe Normand.
     7
     8        Fix size printing and casts in CDMThunder and ClearKey.
     9
     10        * platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp:
     11        (WebCore::CDMProxyClearKey::cencDecryptSubsampled):
     12        * platform/graphics/gstreamer/eme/CDMThunder.cpp:
     13        (WebCore::ParsedResponseMessage::ParsedResponseMessage):
     14        (WebCore::CDMInstanceSessionThunder::requestLicense):
     15        (WebCore::CDMInstanceSessionThunder::updateLicense):
     16        (WebCore::CDMInstanceSessionThunder::loadSession):
     17        (WebCore::CDMInstanceSessionThunder::removeSessionData):
     18
    1192020-10-26  Zalan Bujtas  <zalan@apple.com>
    220
  • trunk/Source/WebCore/platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp

    r264219 r268975  
    185185
    186186        // FIXME: These are high-frequency messages, not sure if there's a better logging lib in WebCore.
    187         LOG(EME, "EME - subsample index %u - %u bytes clear (%lu bytes left to decrypt)", subsampleIndex, subsampleNumClearBytes, input.encryptedBufferSizeInBytes - encryptedBufferByteOffset);
     187        LOG(EME, "EME - subsample index %u - %u bytes clear (%zu bytes left to decrypt)", subsampleIndex, subsampleNumClearBytes, input.encryptedBufferSizeInBytes - encryptedBufferByteOffset);
    188188
    189189        encryptedBufferByteOffset += subsampleNumClearBytes;
    190190
    191191        if (subsampleNumEncryptedBytes) {
    192             LOG(EME, "EME - subsample index %u - %u bytes encrypted (%lu bytes left to decrypt)", subsampleIndex, subsampleNumEncryptedBytes, input.encryptedBufferSizeInBytes - encryptedBufferByteOffset);
     192            LOG(EME, "EME - subsample index %u - %u bytes encrypted (%zu bytes left to decrypt)", subsampleIndex, subsampleNumEncryptedBytes, input.encryptedBufferSizeInBytes - encryptedBufferByteOffset);
    193193
    194194            if (gcry_error_t cipherError = gcry_cipher_decrypt(gCryptHandle(), input.encryptedBuffer + encryptedBufferByteOffset, subsampleNumEncryptedBytes, 0, 0)) {
  • trunk/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp

    r268968 r268975  
    315315
    316316        StringView payload(reinterpret_cast<const LChar*>(buffer->data()), buffer->size());
    317         size_t typePosition = payload.find(":Type:");
     317        StringView type(reinterpret_cast<const LChar*>(":Type:"), 6);
     318        size_t typePosition = payload.find(type, 0);
    318319        StringView requestType(payload.characters8(), typePosition != notFound ? typePosition : 0);
    319320        unsigned offset = 0u;
    … …  
    464465    m_initData = InitData(instance->keySystem(), WTFMove(initDataSharedBuffer));
    465466
    466     GST_TRACE("Going to request a new session id, init data size %lu", m_initData.payload()->size());
     467    GST_TRACE("Going to request a new session id, init data size %zu", m_initData.payload()->size());
    467468    GST_MEMDUMP("init data", m_initData.payload()->dataAsUInt8Ptr(), m_initData.payload()->size());
    468469
    … …  
    530531                if (parsedResponseMessage.hasPayload()) {
    531532                    Ref<SharedBuffer> message = WTFMove(parsedResponseMessage.payload());
    532                     GST_DEBUG("got message of size %lu", message->size());
     533                    GST_DEBUG("got message of size %zu", message->size());
    533534                    GST_MEMDUMP("message", message->dataAsUInt8Ptr(), message->size());
    534535                    callback(false, WTF::nullopt, WTF::nullopt,
    … …  
    536537                            WTFMove(message)), SuccessValue::Succeeded);
    537538                } else {
    538                     GST_ERROR("message of size %lu incorrectly formatted", responseMessage ? responseMessage->size() : 0);
     539                    GST_ERROR("message of size %zu incorrectly formatted", responseMessage ? responseMessage->size() : 0);
    539540                    callback(false, WTF::nullopt, WTF::nullopt, WTF::nullopt, SuccessValue::Failed);
    540541                }
    … …  
    564565                if (parsedResponseMessage.hasPayload()) {
    565566                    Ref<SharedBuffer> message = WTFMove(parsedResponseMessage.payload());
    566                     GST_DEBUG("got message of size %lu", message->size());
     567                    GST_DEBUG("got message of size %zu", message->size());
    567568                    GST_MEMDUMP("message", message->dataAsUInt8Ptr(), message->size());
    568569                    callback(WTF::nullopt, WTF::nullopt, std::make_pair(parsedResponseMessage.typeOr(MediaKeyMessageType::LicenseRequest),
    569570                        WTFMove(message)), SuccessValue::Succeeded, SessionLoadFailure::None);
    570571                } else {
    571                     GST_ERROR("message of size %lu incorrectly formatted", responseMessage ? responseMessage->size() : 0);
     572                    GST_ERROR("message of size %zu incorrectly formatted", responseMessage ? responseMessage->size() : 0);
    572573                    callback(WTF::nullopt, WTF::nullopt, WTF::nullopt, SuccessValue::Failed, SessionLoadFailure::Other);
    573574                }
    … …  
    610611                if (parsedResponseMessage.hasPayload()) {
    611612                    Ref<SharedBuffer> message = WTFMove(parsedResponseMessage.payload());
    612                     GST_DEBUG("session %s removed, message length %lu", m_sessionID.utf8().data(), message->size());
     613                    GST_DEBUG("session %s removed, message length %zu", m_sessionID.utf8().data(), message->size());
    613614                    callback(m_keyStore.allKeysAs(MediaKeyStatus::Released), WTFMove(message), SuccessValue::Succeeded);
    614615                } else {
    615                     GST_WARNING("message of size %lu incorrectly formatted as session %s removal answer", buffer ? buffer->size() : 0,
     616                    GST_WARNING("message of size %zu incorrectly formatted as session %s removal answer", buffer ? buffer->size() : 0,
    616617                        m_sessionID.utf8().data());
    617618                    callback(m_keyStore.allKeysAs(MediaKeyStatus::InternalError), WTF::nullopt, SuccessValue::Failed);
Note: See TracChangeset for help on using the changeset viewer.