Commit bd3f27ab authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfplat: Fix scanline pointer returned with Lock2D().

parent b9eb121e
......@@ -340,7 +340,7 @@ static HRESULT memory_2d_buffer_lock(struct memory_buffer *buffer, BYTE **scanli
else
{
++buffer->_2d.locks;
*scanline0 = buffer->data;
*scanline0 = buffer->_2d.scanline0;
*pitch = buffer->_2d.pitch;
if (buffer_start)
*buffer_start = buffer->data;
......
......@@ -4694,7 +4694,7 @@ static void test_MFCreate2DMediaBuffer(void)
IMF2DBuffer2 *_2dbuffer2;
IMF2DBuffer *_2dbuffer;
IMFMediaBuffer *buffer;
int i, pitch;
int i, pitch, pitch2;
HRESULT hr;
BOOL ret;
......@@ -4898,6 +4898,12 @@ static void test_MFCreate2DMediaBuffer(void)
hr = IMF2DBuffer_Lock2D(_2dbuffer, &data, &pitch);
ok(hr == S_OK, "Failed to lock buffer, hr %#x.\n", hr);
hr = IMF2DBuffer_GetScanline0AndPitch(_2dbuffer, &data2, &pitch2);
ok(hr == S_OK, "Failed to get scanline, hr %#x.\n", hr);
ok(data2 == data, "Unexpected data pointer.\n");
ok(pitch == pitch2, "Unexpected pitch.\n");
hr = IMF2DBuffer_Unlock2D(_2dbuffer);
ok(hr == S_OK, "Failed to unlock buffer, hr %#x.\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment