summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergii Iegorov2013-06-06 08:54:07 -0500
committerSergii Iegorov2013-06-07 06:03:09 -0500
commit5d355bd7506a78019435846e51d1b52834d7adb8 (patch)
treec16f42fdd497b14b1f1d0444213e7f6583413643
parent0bfa06521cb65e0354bde062fb110e06acf728ab (diff)
downloaddevice-ti-common-open-5d355bd7506a78019435846e51d1b52834d7adb8.tar.gz
device-ti-common-open-5d355bd7506a78019435846e51d1b52834d7adb8.tar.xz
device-ti-common-open-5d355bd7506a78019435846e51d1b52834d7adb8.zip
HDMI HAL: Crash fix.
Check pcm pointer for NULL before trying to obtain last error. Change-Id: I977f9b48d6a89bf504848c8bc1a2e6ca924e3e5c Signed-off-by: Sergii Iegorov <x0155539@ti.com>
-rw-r--r--audio/hdmi_audio_hw.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/audio/hdmi_audio_hw.c b/audio/hdmi_audio_hw.c
index cd44aec..eea86a2 100644
--- a/audio/hdmi_audio_hw.c
+++ b/audio/hdmi_audio_hw.c
@@ -385,7 +385,11 @@ ssize_t hdmi_out_write(struct audio_stream_out *stream, const void* buffer,
385 } 385 }
386exit: 386exit:
387 if (ret != 0) { 387 if (ret != 0) {
388 ALOGE("Error writing to HDMI pcm: %s", pcm_get_error(out->pcm)); 388 if (out->pcm) {
389 ALOGE("Error writing to HDMI pcm: %s", pcm_get_error(out->pcm));
390 } else {
391 ALOGE("Error: pcm == 0, err = %d", ret);
392 }
389 hdmi_out_standby((struct audio_stream*)stream); 393 hdmi_out_standby((struct audio_stream*)stream);
390 unsigned int usecs = bytes * 1000000 / 394 unsigned int usecs = bytes * 1000000 /
391 audio_stream_frame_size((struct audio_stream*)stream) / 395 audio_stream_frame_size((struct audio_stream*)stream) /