Skip to content

Commit 947a6b0

Browse files
committed
I2SDriverESP32V1: NPE
1 parent 8a6df3b commit 947a6b0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/AudioTools/CoreAudio/AudioI2S/I2SESP32V1.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ class I2SDriverESP32V1 {
253253
// use the legicy size parameters for frame num
254254
int size = cfg.buffer_size * cfg.buffer_count;
255255
int frame_size = get_bits_eff(cfg.bits_per_sample) * cfg.channels / 8;
256+
frame_size = (frame_size == 0) ? 1 : frame_size;
256257
if (size > 0) result.dma_frame_num = size / frame_size;
257258
LOGI("dma_frame_num: %d", (int)result.dma_frame_num);
258259
result.auto_clear = cfg.auto_clear;

0 commit comments

Comments
 (0)