Changeset 202617 in webkit


Ignore:
Timestamp:
Jun 29, 2016 3:19:36 AM (8 years ago)
Author:
ddkilzer@apple.com
Message:

Throw exceptions for invalid number of channels for ConvolverNode
<https://webkit.org/b/159238>
<rdar://problem/27020410>

Reviewed by Brent Fulgham.

Source/WebCore:

Fix based on a Blink change (patch by <rtoy@chromium.org>):
<https://chromium.googlesource.com/chromium/src.git/+/0cc26bbb7175aec77910d0b47faf9f8c8a640fe5>

Test: webaudio/convolver-channels.html

  • Modules/webaudio/ConvolverNode.cpp:

(WebCore::ConvolverNode::setBuffer): Throw an exception for
anything but 1, 2 or 4 channels.

LayoutTests:

Test based on a Blink change (patch by <rtoy@chromium.org>):
<https://chromium.googlesource.com/chromium/src.git/+/0cc26bbb7175aec77910d0b47faf9f8c8a640fe5>

compatibility.js based on a Blink change (patch by <Raymond Toy>):
<https://chromium.googlesource.com/chromium/src.git/+/f846f5a461d1fcdbe5152898576c125058079ed1>

  • webaudio/convolver-channels-expected.txt: Added.
  • webaudio/convolver-channels.html: Added.
  • webaudio/resources/compatibility.js: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r202610 r202617  
     12016-06-29  David Kilzer  <ddkilzer@apple.com>
     2
     3        Throw exceptions for invalid number of channels for ConvolverNode
     4        <https://webkit.org/b/159238>
     5        <rdar://problem/27020410>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Test based on a Blink change (patch by <rtoy@chromium.org>):
     10        <https://chromium.googlesource.com/chromium/src.git/+/0cc26bbb7175aec77910d0b47faf9f8c8a640fe5>
     11
     12        compatibility.js based on a Blink change (patch by <rtoy@google.com>):
     13        <https://chromium.googlesource.com/chromium/src.git/+/f846f5a461d1fcdbe5152898576c125058079ed1>
     14
     15        * webaudio/convolver-channels-expected.txt: Added.
     16        * webaudio/convolver-channels.html: Added.
     17        * webaudio/resources/compatibility.js: Added.
     18
    1192016-06-28  Frederic Wang  <fwang@igalia.com>
    220
  • trunk/Source/WebCore/ChangeLog

    r202616 r202617  
     12016-06-29  David Kilzer  <ddkilzer@apple.com>
     2
     3        Throw exceptions for invalid number of channels for ConvolverNode
     4        <https://webkit.org/b/159238>
     5        <rdar://problem/27020410>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Fix based on a Blink change (patch by <rtoy@chromium.org>):
     10        <https://chromium.googlesource.com/chromium/src.git/+/0cc26bbb7175aec77910d0b47faf9f8c8a640fe5>
     11
     12        Test: webaudio/convolver-channels.html
     13
     14        * Modules/webaudio/ConvolverNode.cpp:
     15        (WebCore::ConvolverNode::setBuffer): Throw an exception for
     16        anything but 1, 2 or 4 channels.
     17
    1182016-06-29  Carlos Garcia Campos  <cgarcia@igalia.com>
    219
  • trunk/Source/WebCore/Modules/webaudio/ConvolverNode.cpp

    r196603 r202617  
    11/*
    22 * Copyright (C) 2010, Google Inc. All rights reserved.
     3 * Copyright (C) 2016, Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    132133    size_t bufferLength = buffer->length();
    133134
    134     // The current implementation supports up to four channel impulse responses, which are interpreted as true-stereo (see Reverb class).
    135     bool isBufferGood = numberOfChannels > 0 && numberOfChannels <= 4 && bufferLength;
    136     ASSERT(isBufferGood);
    137     if (!isBufferGood)
     135    // The current implementation supports only 1-, 2-, or 4-channel impulse responses, with the
     136    // 4-channel response being interpreted as true-stereo (see Reverb class).
     137    bool isChannelCountGood = numberOfChannels == 1 || numberOfChannels == 2 || numberOfChannels == 4;
     138
     139    if (!isChannelCountGood) {
     140        ec = NOT_SUPPORTED_ERR;
    138141        return;
     142    }
    139143
    140144    // Wrap the AudioBuffer by an AudioBus. It's an efficient pointer set and not a memcpy().
Note: See TracChangeset for help on using the changeset viewer.