[Android] SlidingPane: avoid NULL dereference

Jean-Baptiste Kempf git at videolan.org
Sun Apr 13 17:45:03 CEST 2014


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Apr 13 17:40:01 2014 +0200| [c461d517eb4166c8867ec1570210ceaaddd43b47] | committer: Jean-Baptiste Kempf

SlidingPane: avoid NULL dereference

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=c461d517eb4166c8867ec1570210ceaaddd43b47
---

 vlc-android/src/org/videolan/vlc/widget/SlidingPaneLayout.java |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/widget/SlidingPaneLayout.java b/vlc-android/src/org/videolan/vlc/widget/SlidingPaneLayout.java
index 3b0276f..a98e320 100644
--- a/vlc-android/src/org/videolan/vlc/widget/SlidingPaneLayout.java
+++ b/vlc-android/src/org/videolan/vlc/widget/SlidingPaneLayout.java
@@ -187,9 +187,10 @@ public class SlidingPaneLayout extends ViewGroup {
         if (attrs != null) {
             TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.SlidingPaneLayout);
 
-            if (ta != null)
+            if (ta != null) {
                 mOverhangSize = ta.getDimensionPixelSize(R.styleable.SlidingPaneLayout_overhangSize, -1);
-            ta.recycle();
+                ta.recycle();
+            }
         }
 
         final float density = context.getResources().getDisplayMetrics().density;



More information about the Android mailing list