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.
Bug: 145262423
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
Change-Id: If4ea3dfbfbd1fc9a7fbe0b5dfdc549f919ac2b40
Merged-In: If4ea3dfbfbd1fc9a7fbe0b5dfdc549f919ac2b40
(cherry picked from commit a486d6d653421da2a0f548138ca45b61fecc7b5e)
1 file changed