[FFmpeg-devel] [PATCH] Fix the wmavoice-7k fate test (failures on OpenBSD)

Ronald S. Bultje rsbultje
Mon Aug 9 02:30:23 CEST 2010


On Sun, Aug 8, 2010 at 8:17 PM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> On Sat, Aug 7, 2010 at 6:12 AM, Martin Storsj? <martin at martin.st> wrote:
>> I checked out the wmavoice-7k fate test failures that occurred on OpenBSD,
>> and actually got crashes in these tests on Mac OS X, too, under some
>> compilation configurations.
>> I tracked down the issue to aw_pulse_set2, where the loop around lines
>> 1071- may write outside of the use_mask buffer if pulse_off starts out
>> negative.
>> The first patch fixes the issue and makes the test pass on OpenBSD, but
>> it's a bit ugly. The second patch also fixes the issue, but changes the
>> output of the test (but it still sounds the same to me). I believe this is
>> the more correct way to fix the issue, but requires the reference sample
>> in the testsuite to be updated.
> I think neither are correct. The pulse exclusion length should not be
> affected, but the ones with a negative offset should be skipped. Given
> that, the second patch is definitely wrong, but the first patch is
> probably not right either.
> Since checking length and recalculating length, offset (and so on)
> would affect speed significantly, I feel the better (and safer) thing
> to do is to pad use_mask with two uint16_ts _before_ the pointer start
> (similar to how we pad it with two uint16_ts _after_ currently). That
> way, even if idx is the minimum value (-23), it would still write in
> valid memory (use_mask[-23 >> 4] = use_mask[-2]). these values should
> be initialized to zero, similar to the post-use_mask-pad values. At
> the same time, no length checks are necessary, and thus the code is
> safe even with negative offset values.

As in attached. I'll try to test later, if anyone else can test I'd
appreciate it.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: wmavoice_use_mask_overflow.patch
Type: application/octet-stream
Size: 1193 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100808/cd26a71c/attachment.obj>

More information about the ffmpeg-devel mailing list