summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergii Iegorov <x0155539@ti.com>2013-06-06 16:54:07 +0300
committerSergii Iegorov <x0155539@ti.com>2013-06-07 14:03:09 +0300
commit5d355bd7506a78019435846e51d1b52834d7adb8 (patch)
treec16f42fdd497b14b1f1d0444213e7f6583413643
parent0bfa06521cb65e0354bde062fb110e06acf728ab (diff)
downloadcommon-open-5d355bd7506a78019435846e51d1b52834d7adb8.tar.gz
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,
}
exit:
if (ret != 0) {
- ALOGE("Error writing to HDMI pcm: %s", pcm_get_error(out->pcm));
+ if (out->pcm) {
+ ALOGE("Error writing to HDMI pcm: %s", pcm_get_error(out->pcm));
+ } else {
+ ALOGE("Error: pcm == 0, err = %d", ret);
+ }
hdmi_out_standby((struct audio_stream*)stream);
unsigned int usecs = bytes * 1000000 /
audio_stream_frame_size((struct audio_stream*)stream) /