Changeset 293643 in webkit
- Timestamp:
- Apr 30, 2022, 12:26:02 AM (4 years ago)
- Location:
- trunk/Source/ThirdParty/libwebrtc
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
Source/webrtc/sdk/WebKit/WebKitVP8Decoder.cpp (modified) (2 diffs)
-
Source/webrtc/sdk/WebKit/WebKitVP9Decoder.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/ThirdParty/libwebrtc/ChangeLog
r293341 r293643 1 2022-04-30 Jer Noble <jer.noble@apple.com> 2 3 [Mac] VTVideoDecoderClass object pointers can become unaligned on x86 4 https://bugs.webkit.org/show_bug.cgi?id=239916 5 <rdar://92445366> 6 7 Reviewed by Eric Carlson. 8 9 Both the base class and the derived class must be 4-byte aligned on x86, or there 10 is a chance that a pointer member of that struct will cross a page boundary, and 11 dereferencing that pointer will fail. 12 13 * Source/webrtc/sdk/WebKit/WebKitVP8Decoder.cpp: 14 * Source/webrtc/sdk/WebKit/WebKitVP9Decoder.cpp: 15 1 16 2022-04-25 Tim Horton <timothy_horton@apple.com> 2 17 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitVP8Decoder.cpp
r285577 r293643 56 56 57 57 #pragma pack(push, 4) 58 struct Decoder Class {58 struct DecoderBaseClass { 59 59 uint8_t pad[padSize]; 60 60 CMBaseClass alignedClass; 61 61 }; 62 62 63 static const Decoder Class WebKitVP8Decoder_BaseClass {63 static const DecoderBaseClass WebKitVP8Decoder_BaseClass { 64 64 { }, 65 65 { … … 83 83 static_assert(sizeof(WebKitVP8Decoder_BaseClass.alignedClass.version) == sizeof(uintptr_t), "CMBaseClass fixup is not required!"); 84 84 #endif 85 static_assert(offsetof(DecoderBaseClass, alignedClass) == padSize, "CMBaseClass offset is incorrect!"); 86 static_assert(alignof(DecoderBaseClass) == 4, "CMBaseClass must have 4 byte alignment"); 87 88 static OSStatus startVP8DecoderSession(VTVideoDecoderRef, VTVideoDecoderSession, CMVideoFormatDescriptionRef); 89 static OSStatus decodeVP8DecoderFrame(VTVideoDecoderRef, VTVideoDecoderFrame, CMSampleBufferRef, VTDecodeFrameFlags, VTDecodeInfoFlags*); 90 91 #pragma pack(push, 4) 92 struct DecoderClass { 93 uint8_t pad[padSize]; 94 VTVideoDecoderClass alignedClass; 95 }; 96 97 static const DecoderClass WebKitVP8Decoder_VideoDecoderClass = 98 { 99 { }, 100 { 101 kVTVideoDecoder_ClassVersion_1, 102 startVP8DecoderSession, 103 decodeVP8DecoderFrame, 104 nullptr, // VTVideoDecoderFunction_CopySupportedPropertyDictionary, 105 nullptr, // VTVideoDecoderFunction_SetProperties 106 nullptr, // VTVideoDecoderFunction_CopySerializableProperties 107 nullptr, // VTVideoDecoderFunction_CanAcceptFormatDescription 108 nullptr, // VTVideoDecoderFunction_FinishDelayedFrames 109 nullptr, // VTVideoDecoderFunction_StartTileSession 110 nullptr, // VTVideoDecoderFunction_DecodeTile 111 nullptr // VTVideoDecoderFunction_FinishDelayedTiles 112 } 113 }; 114 #pragma pack(pop) 115 116 #if defined(CMBASE_OBJECT_NEEDS_ALIGNMENT) && CMBASE_OBJECT_NEEDS_ALIGNMENT 117 static_assert(sizeof(WebKitVP8Decoder_VideoDecoderClass.alignedClass.version) == sizeof(uint32_t), "CMBaseClass fixup is required!"); 118 #else 119 static_assert(sizeof(WebKitVP8Decoder_VideoDecoderClass.alignedClass.version) == sizeof(uintptr_t), "CMBaseClass fixup is not required!"); 120 #endif 85 121 static_assert(offsetof(DecoderClass, alignedClass) == padSize, "CMBaseClass offset is incorrect!"); 86 122 static_assert(alignof(DecoderClass) == 4, "CMBaseClass must have 4 byte alignment"); 87 123 88 static OSStatus startVP8DecoderSession(VTVideoDecoderRef, VTVideoDecoderSession, CMVideoFormatDescriptionRef);89 static OSStatus decodeVP8DecoderFrame(VTVideoDecoderRef, VTVideoDecoderFrame, CMSampleBufferRef, VTDecodeFrameFlags, VTDecodeInfoFlags*);90 91 static const VTVideoDecoderClass WebKitVP8Decoder_VideoDecoderClass =92 {93 kVTVideoDecoder_ClassVersion_1,94 startVP8DecoderSession,95 decodeVP8DecoderFrame,96 nullptr, // VTVideoDecoderFunction_CopySupportedPropertyDictionary,97 nullptr, // VTVideoDecoderFunction_SetProperties98 nullptr, // VTVideoDecoderFunction_CopySerializableProperties99 nullptr, // VTVideoDecoderFunction_CanAcceptFormatDescription100 nullptr, // VTVideoDecoderFunction_FinishDelayedFrames101 nullptr, // VTVideoDecoderFunction_StartTileSession102 nullptr, // VTVideoDecoderFunction_DecodeTile103 nullptr // VTVideoDecoderFunction_FinishDelayedTiles104 };105 106 124 static const VTVideoDecoderVTable WebKitVP8DecoderVTable = 107 125 { 108 126 { nullptr, &WebKitVP8Decoder_BaseClass.alignedClass }, 109 &WebKitVP8Decoder_VideoDecoderClass 127 &WebKitVP8Decoder_VideoDecoderClass.alignedClass 110 128 }; 111 129 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitVP9Decoder.cpp
r285577 r293643 56 56 57 57 #pragma pack(push, 4) 58 struct Decoder Class {58 struct DecoderBaseClass { 59 59 uint8_t pad[padSize]; 60 60 CMBaseClass alignedClass; 61 61 }; 62 62 63 static const Decoder Class WebKitVP9Decoder_BaseClass {63 static const DecoderBaseClass WebKitVP9Decoder_BaseClass { 64 64 { }, 65 65 { … … 83 83 static_assert(sizeof(WebKitVP9Decoder_BaseClass.alignedClass.version) == sizeof(uintptr_t), "CMBaseClass fixup is not required!"); 84 84 #endif 85 static_assert(offsetof(Decoder Class, alignedClass) == padSize, "CMBaseClass offset is incorrect!");86 static_assert(alignof(Decoder Class) == 4, "CMBaseClass must have 4 byte alignment");85 static_assert(offsetof(DecoderBaseClass, alignedClass) == padSize, "CMBaseClass offset is incorrect!"); 86 static_assert(alignof(DecoderBaseClass) == 4, "CMBaseClass must have 4 byte alignment"); 87 87 88 88 static OSStatus startVP9DecoderSession(VTVideoDecoderRef, VTVideoDecoderSession, CMVideoFormatDescriptionRef); 89 89 static OSStatus decodeVP9DecoderFrame(VTVideoDecoderRef, VTVideoDecoderFrame, CMSampleBufferRef, VTDecodeFrameFlags, VTDecodeInfoFlags*); 90 90 91 static const VTVideoDecoderClass WebKitVP9Decoder_VideoDecoderClass = 92 { 93 kVTVideoDecoder_ClassVersion_1, 94 startVP9DecoderSession, 95 decodeVP9DecoderFrame, 96 nullptr, // VTVideoDecoderFunction_CopySupportedPropertyDictionary, 97 nullptr, // VTVideoDecoderFunction_SetProperties 98 nullptr, // VTVideoDecoderFunction_CopySerializableProperties 99 nullptr, // VTVideoDecoderFunction_CanAcceptFormatDescription 100 nullptr, // VTVideoDecoderFunction_FinishDelayedFrames 101 nullptr, // VTVideoDecoderFunction_StartTileSession 102 nullptr, // VTVideoDecoderFunction_DecodeTile 103 nullptr // VTVideoDecoderFunction_FinishDelayedTiles 104 }; 91 #pragma pack(push, 4) 92 struct DecoderClass { 93 uint8_t pad[padSize]; 94 VTVideoDecoderClass alignedClass; 95 }; 96 97 static const DecoderClass WebKitVP9Decoder_VideoDecoderClass = 98 { 99 { }, 100 { 101 kVTVideoDecoder_ClassVersion_1, 102 startVP9DecoderSession, 103 decodeVP9DecoderFrame, 104 nullptr, // VTVideoDecoderFunction_CopySupportedPropertyDictionary, 105 nullptr, // VTVideoDecoderFunction_SetProperties 106 nullptr, // VTVideoDecoderFunction_CopySerializableProperties 107 nullptr, // VTVideoDecoderFunction_CanAcceptFormatDescription 108 nullptr, // VTVideoDecoderFunction_FinishDelayedFrames 109 nullptr, // VTVideoDecoderFunction_StartTileSession 110 nullptr, // VTVideoDecoderFunction_DecodeTile 111 nullptr // VTVideoDecoderFunction_FinishDelayedTiles 112 } 113 }; 114 #pragma pack(pop) 105 115 106 116 static const VTVideoDecoderVTable WebKitVP9DecoderVTable = 107 117 { 108 118 { nullptr, &WebKitVP9Decoder_BaseClass.alignedClass }, 109 &WebKitVP9Decoder_VideoDecoderClass 119 &WebKitVP9Decoder_VideoDecoderClass.alignedClass 110 120 }; 111 121
Note:
See TracChangeset
for help on using the changeset viewer.