Commit 7ee40216 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

avifil32: AVIFileGetStream should set stream to NULL in case of an error.

parent 981b9794
...@@ -316,6 +316,7 @@ static HRESULT WINAPI IAVIFile_fnGetStream(IAVIFile *iface, IAVIStream **avis, D ...@@ -316,6 +316,7 @@ static HRESULT WINAPI IAVIFile_fnGetStream(IAVIFile *iface, IAVIStream **avis, D
} }
/* Sorry, but the specified stream doesn't exist */ /* Sorry, but the specified stream doesn't exist */
*avis = NULL;
return AVIERR_NODATA; return AVIERR_NODATA;
} }
......
...@@ -373,6 +373,11 @@ static void test_default_data(void) ...@@ -373,6 +373,11 @@ static void test_default_data(void)
res = AVIFileOpenA(&pFile, filename, OF_SHARE_DENY_WRITE, 0L); res = AVIFileOpenA(&pFile, filename, OF_SHARE_DENY_WRITE, 0L);
ok(res == 0, "Unable to open file: error=%u\n", res); ok(res == 0, "Unable to open file: error=%u\n", res);
pStream0 = (void *)0xdeadbeef;
res = AVIFileGetStream(pFile, &pStream0, ~0U, 0);
ok(res == AVIERR_NODATA, "expected AVIERR_NODATA, got %u\n", res);
ok(pStream0 == NULL, "AVIFileGetStream should set stream to NULL\n");
res = AVIFileGetStream(pFile, &pStream0, 0, 0); res = AVIFileGetStream(pFile, &pStream0, 0, 0);
ok(res == 0, "Unable to open video stream: error=%u\n", res); ok(res == 0, "Unable to open video stream: error=%u\n", res);
......
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