Skip to content

Commit 16b2509

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 3b037bf + 276e403 commit 16b2509

4 files changed

Lines changed: 16 additions & 8 deletions

File tree

.github/workflows/python-build-test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ on:
77
push:
88
branches: [ master ]
99
pull_request:
10-
branches: [ master ]
10+
branches: [ master, dev ]
1111

1212
jobs:
1313
build:
14-
1514
runs-on: ubuntu-latest
1615
strategy:
1716
fail-fast: false

.github/workflows/python-publish.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# separate terms of service, privacy policy, and support
77
# documentation.
88

9-
name: Upload Python Package
9+
name: Publish to pypi
1010

1111
on:
1212
release:
@@ -17,7 +17,7 @@ jobs:
1717
name: Build wheels on ${{ matrix.os }}
1818
runs-on: ${{ matrix.os }}
1919
strategy:
20-
fail-fast: false
20+
fail-fast: true
2121
matrix:
2222
os: [ubuntu-latest, windows-latest, macos-latest]
2323

@@ -39,6 +39,7 @@ jobs:
3939
with:
4040
fetch-depth: 0 # Optional, use if you use setuptools_scm
4141
submodules: true # Optional, use if you have submodules
42+
4243
- name: Build SDist
4344
run: pipx run build --sdist
4445

src/pysilk/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55

66
def is_silk_data(raw: bytes) -> bool:
77
if len(raw) > 10:
8-
if raw[:10] == b"\x02#!SILK_V3":
8+
offset = 0
9+
if raw[0] == 2:
10+
offset = 1
11+
if raw[offset:10] == b"#!SILK_V3":
912
return True
1013
return False
1114

src/silk/codec.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,13 @@ silkDecode(unsigned char *silkData, int dataLen,
137137
SKP_SILK_SDK_DecControlStruct DecControl;
138138

139139
/* Check Silk header */
140-
if (strncmp((char *) psRead, "\x02#!SILK_V3", 0x0A) != 0)
141-
goto failed;
140+
if (psRead[0] == 0x02) {
141+
if (strncmp((char *) psRead, "\x02#!SILK_V3", 0x0A) != 0)
142+
goto failed;
143+
} else {
144+
if (strncmp((char *) psRead, "#!SILK_V3", 0x09) != 0)
145+
goto failed;
146+
}
142147

143148
psRead += 0x0A;
144149

@@ -286,4 +291,4 @@ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
286291
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
287292
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
288293
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
289-
***********************************************************************/
294+
***********************************************************************/

0 commit comments

Comments
 (0)