From 35381518d0511d1860adea0183f425cdfb4245d4 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Mon, 28 Feb 2011 16:15:33 +0000 Subject: [PATCH] Don't try to output really long URLs HTML5Audio exception handler. If we catch an IOException in HTML5Audio.setDataSource, do not try and output the URL if it's really long as this will likely lead to an OOM exception being thrown. Bug: 3486963 Change-Id: If10a489b03ec215e078490a81910b02d68190612 --- core/java/android/webkit/HTML5Audio.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/java/android/webkit/HTML5Audio.java b/core/java/android/webkit/HTML5Audio.java index a3906ddb76c4f..6fc0d119f9c91 100644 --- a/core/java/android/webkit/HTML5Audio.java +++ b/core/java/android/webkit/HTML5Audio.java @@ -173,7 +173,8 @@ class HTML5Audio extends Handler mState = INITIALIZED; mMediaPlayer.prepareAsync(); } catch (IOException e) { - Log.e(LOGTAG, "couldn't load the resource: " + url + " exc: " + e); + String debugUrl = url.length() > 128 ? url.substring(0, 128) + "..." : url; + Log.e(LOGTAG, "couldn't load the resource: "+ debugUrl +" exc: " + e); resetMediaPlayer(); } }