13
0

Fix "Branch condition evaluates to a garbage value"

in PBD::RingBuffer, vec.buf[1] is not set when vec.len[1] == 0
This commit is contained in:
Robin Gareus 2023-09-19 18:25:31 +02:00
parent 6edbc21929
commit b18533119b
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -236,7 +236,7 @@ FFMPEGFileImportableSource::did_read_data (std::string data, size_t size)
samplecnt_t written = 0; samplecnt_t written = 0;
for (int i = 0; i < 2; ++i) { for (int i = 0; i < 2; ++i) {
samplecnt_t cnt = std::min<samplecnt_t> (n_samples, wv.len[i]); samplecnt_t cnt = std::min<samplecnt_t> (n_samples, wv.len[i]);
if (!cnt || !wv.buf[i]) { if (!cnt) {
break; break;
} }
memcpy (wv.buf[i], cur, cnt * sizeof (float)); memcpy (wv.buf[i], cur, cnt * sizeof (float));