audio_utils: check for zero numBytes in SPDIFEncoder
Fuzzing revealed that it was possible to read one word past the end
of the burst buffer in the SPDIF Encoder. We can avoid that corner
case by checking for numBytes equal to zero.
Test: see b/145262423#53 for fuzzing test instructions
Test: atest spdif_tests
Test: But if that does not work, try this:
Test: mmm system/media/audio_utils
Test: adb push $OUT/data/nativetest64/spdif_tests/spdif_tests /system/bin/.
Test: adb shell spdif_tests
(cherry picked from commit a486d6d653421da2a0f548138ca45b61fecc7b5e)
1 file changed