[PATCH] mfplat/tests: Print an error if the first call to get_event fails in test_source_resolver (Coverity)

Alex Henrie alexhenrie24 at gmail.com
Mon Dec 27 00:55:13 CST 2021


On Sun, Dec 26, 2021 at 11:45 PM Nikolay Sivov <nsivov at codeweavers.com> wrote:
>
> On 12/27/21 02:11, Alex Henrie wrote:
> > -    video_stream = NULL;
> > -    if (get_event((IMFMediaEventGenerator *)mediasource, MENewStream, &var))
> > -    {
> > -        ok(var.vt == VT_UNKNOWN, "Unexpected value type.\n");
> > -        video_stream = (IMFMediaStream *)var.punkVal;
> > -    }
> > +    ret = get_event((IMFMediaEventGenerator *)mediasource, MENewStream, &var);
> > +    ok(ret, "Failed to get event.\n");
> > +    ok(var.vt == VT_UNKNOWN, "Unexpected value type.\n");
> > +    video_stream = (IMFMediaStream *)var.punkVal;
> The point is that if it's not MENewStream, you won't necessarily have
> IMFMediaStream in event data.

If that ever happened, the next test would crash because video_stream
would be null (hence the Coverity warning). So, as they are currently
written, the tests assume that the first call to get_event will
succeed. Is there any version of Windows that we care about where the
first call to get_event fails?

-Alex



More information about the wine-devel mailing list