Commit 1113f42a authored by Brendan McGrath's avatar Brendan McGrath Committed by Alexandre Julliard

qedit: Do not force the sample to be freed in SampleGrabber_callback().

Remove a work around that causes a crash in Unravel Two. There is a callback in Unravel Two that appears to add a reference to a IMediaSample, which this workaround treats as a leak and releases. However, the application also later releases the reference itself, causing a use-after-free. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51616Signed-off-by: 's avatarBrendan McGrath <brendan@redmandi.com> Signed-off-by: 's avatarZebediah Figura <zfigura@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 2f280d0d
...@@ -164,9 +164,6 @@ static void SampleGrabber_callback(struct sample_grabber *This, IMediaSample *sa ...@@ -164,9 +164,6 @@ static void SampleGrabber_callback(struct sample_grabber *This, IMediaSample *sa
if (ref) if (ref)
{ {
ERR("(%p) Callback referenced sample %p by %lu\n", This, sample, ref); ERR("(%p) Callback referenced sample %p by %lu\n", This, sample, ref);
/* ugly as hell but some apps are sooo buggy */
while (ref--)
IMediaSample_Release(sample);
} }
} }
break; break;
......
...@@ -1094,7 +1094,7 @@ static void test_samplegrabber(void) ...@@ -1094,7 +1094,7 @@ static void test_samplegrabber(void)
ok(samplecb_called == TRUE, "SampleCB should have been called\n"); ok(samplecb_called == TRUE, "SampleCB should have been called\n");
refcount = IUnknown_Release(&my_sample.sample); refcount = IUnknown_Release(&my_sample.sample);
todo_wine ok(!refcount, "Got unexpected refcount %ld.\n", refcount); ok(!refcount, "Got unexpected refcount %ld.\n", refcount);
IMemInputPin_Release(inpin); IMemInputPin_Release(inpin);
IPin_Release(pin); IPin_Release(pin);
......
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