3 # Copyright (c) 2009 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
7 # Usage: ./test_malicious_fonts.sh [ttf_or_otf_file_name]
10 CHECKER
=.
/validator-checker
12 if [ ! -x "$CHECKER" ] ; then
13 echo "$CHECKER is not found."
17 if [ $# -eq 0 ] ; then
18 # No font file is specified. Apply this script to all TT/OT files under the
20 if [ ! -d $BASE_DIR ] ; then
21 echo "$BASE_DIR does not exist."
25 # Recursively call this script.
26 find $BASE_DIR -type f
-name '*tf' -exec "$0" {} \
;
31 if [ $# -gt 1 ] ; then
32 echo "Usage: $0 [ttf_or_otf_file_name]"
36 # Confirm that the malicious font file does not crash OTS nor OS font renderer.
38 "$CHECKER" "$1" > /dev
/null
2>&1 ||
(echo ; echo "\nFAIL: $1 (Run $CHECKER $1 for more information.)")