diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6bf0900a1..aa94771be 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,9 +39,9 @@ jobs: with: release: '9-2019-q4' - name: Setup python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: '3.14' - name: Build Library run: make -j - name: Build Examples diff --git a/src/util/WavWriter.h b/src/util/WavWriter.h index ae52c11df..ac0718c81 100644 --- a/src/util/WavWriter.h +++ b/src/util/WavWriter.h @@ -176,8 +176,11 @@ class WavWriter if(remaining_size > max_bytes) remaining_size = max_bytes; - uint8_t *base = reinterpret_cast(transfer_buff); - f_write(&fp_, base + offset_bytes, remaining_size, &bw); + if(remaining_size > 0) + { + uint8_t *base = reinterpret_cast(transfer_buff); + f_write(&fp_, base + offset_bytes, remaining_size, &bw); + } } // 3. Finalize header and close diff --git a/tests/FatFsMock.cpp b/tests/FatFsMock.cpp index ea0c8ac10..82276145c 100644 --- a/tests/FatFsMock.cpp +++ b/tests/FatFsMock.cpp @@ -44,7 +44,8 @@ FRESULT f_write(FIL* fp, const void* buff, UINT btw, UINT* bw) if(state.file_data.size() < end_idx) state.file_data.resize(end_idx, 0); - std::memcpy(&state.file_data[start_idx], buff, static_cast(btw)); + if(btw > 0) + std::memcpy(&state.file_data[start_idx], buff, static_cast(btw)); state.cursor += btw; if(bw) *bw = btw;