[PATCH 1/7] mfplat/tests: Check that buffers are properly aligned.

Giovanni Mascellani gmascellani at codeweavers.com
Mon Feb 14 14:25:02 CST 2022


Hi,

Il 14/02/22 19:51, Nikolay Sivov ha scritto:
> Thanks, looks like this checks out for alignment values I tried. There 
> is one issue with using _aligned_malloc() for this - it requires power 
> of 2 for alignment argument, understandably. Media buffer function does 
> not have this requirement.

Ah, you're right. But do you know what MFCreateAlignedMemoryBuffer is 
actually doing here? I.e., I tested calling 
MFCreateAlignedMemoryBuffer(201, 101, &buffer), but it didn't return a 
buffer aligned to 102 (such that, that is, address % 102 == 0). Do you 
know what is supposed to happen here?

I suppose we just have to mangle the alignment the proper way, without 
needing to use an additional pointer, and then we can just call 
_aligned_malloc() again.

Thanks, Giovanni.



More information about the wine-devel mailing list