Dmitry Timoshkov : avifil32: AVIFileGetStream should set stream to NULL in case of an error.
Alexandre Julliard
julliard at winehq.org
Mon Jan 30 15:39:15 CST 2017
Module: wine
Branch: master
Commit: 7ee4021694630d7ed1d0cd4d87c2ec79911609ba
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7ee4021694630d7ed1d0cd4d87c2ec79911609ba
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Thu Jan 26 17:32:53 2017 +0100
avifil32: AVIFileGetStream should set stream to NULL in case of an error.
Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/avifil32/avifile.c | 1 +
dlls/avifil32/tests/api.c | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/dlls/avifil32/avifile.c b/dlls/avifil32/avifile.c
index f649d05..7a4caaa 100644
--- a/dlls/avifil32/avifile.c
+++ b/dlls/avifil32/avifile.c
@@ -316,6 +316,7 @@ static HRESULT WINAPI IAVIFile_fnGetStream(IAVIFile *iface, IAVIStream **avis, D
}
/* Sorry, but the specified stream doesn't exist */
+ *avis = NULL;
return AVIERR_NODATA;
}
diff --git a/dlls/avifil32/tests/api.c b/dlls/avifil32/tests/api.c
index b3d822d..66ba205 100644
--- a/dlls/avifil32/tests/api.c
+++ b/dlls/avifil32/tests/api.c
@@ -373,6 +373,11 @@ static void test_default_data(void)
res = AVIFileOpenA(&pFile, filename, OF_SHARE_DENY_WRITE, 0L);
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);
ok(res == 0, "Unable to open video stream: error=%u\n", res);
More information about the wine-cvs
mailing list