From 29cd8ec0514f4703571d37594d553e88c055234a Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Thu, 20 Jun 2002 18:31:03 +0000 Subject: [PATCH] Sanity check the sources we're passed for compositing. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1511 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/cast/CompositedActionFrames.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/cast/CompositedActionFrames.java b/src/java/com/threerings/cast/CompositedActionFrames.java index ff584ab17..01c7ea3de 100644 --- a/src/java/com/threerings/cast/CompositedActionFrames.java +++ b/src/java/com/threerings/cast/CompositedActionFrames.java @@ -1,5 +1,5 @@ // -// $Id: CompositedActionFrames.java,v 1.5 2002/06/19 23:31:57 mdb Exp $ +// $Id: CompositedActionFrames.java,v 1.6 2002/06/20 18:31:03 mdb Exp $ package com.threerings.cast; @@ -29,7 +29,14 @@ public class CompositedActionFrames */ public CompositedActionFrames (ActionFrames[] sources) { + // sanity check + if (sources == null || sources.length == 0) { + String errmsg = "Requested to composite invalid set of source " + + "frames! [sources=" + StringUtil.toString(sources) + "]."; + throw new RuntimeException(errmsg); + } _sources = sources; + // the sources must all have the same frame count, and each // orientation must also have the same frame count, so we just use // the count from the first source and first orientation