OSDN Git Service

VideoEditor: Fixes Issue ID:3448077
authorBasavapatna Dattaguru <dattaguru@google.com>
Fri, 11 Feb 2011 23:59:51 +0000 (15:59 -0800)
committerBasavapatna Dattaguru <dattaguru@google.com>
Sat, 12 Feb 2011 02:03:01 +0000 (18:03 -0800)
Updated with review comments. checks width & height

Change-Id: I79bd28862f511e7653e7e7a63c88772834ee6559

media/java/android/media/videoeditor/EffectKenBurns.java

index 9ef458b..64be6b8 100755 (executable)
@@ -53,6 +53,13 @@ public class EffectKenBurns extends Effect {
                          Rect endRect, long startTimeMs, long durationMs) {
         super(mediaItem, effectId, startTimeMs, durationMs);
 
+        if ( (startRect.width() <= 0) || (startRect.height() <= 0) ) {
+            throw new IllegalArgumentException("Invalid Start rectangle");
+        }
+        if ( (endRect.width() <= 0) || (endRect.height() <= 0) ) {
+            throw new IllegalArgumentException("Invalid End rectangle");
+        }
+
         mStartRect = startRect;
         mEndRect = endRect;
     }