1// Copyright (C) 2016 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15package { 16 // See: http://go/android-license-faq 17 // A large-scale-change added 'default_applicable_licenses' to import 18 // all of the 'license_kinds' from "frameworks_base_license" 19 // to get the below license kinds: 20 // SPDX-license-identifier-Apache-2.0 21 default_applicable_licenses: ["frameworks_base_license"], 22} 23 24cc_library_shared { 25 name: "libjnigraphics", 26 defaults: [ 27 "bug_24465209_workaround", 28 ], 29 30 cflags: [ 31 "-Wall", 32 "-Werror", 33 "-Wunused", 34 "-Wunreachable-code", 35 ], 36 37 srcs: [ 38 "imagedecoder.cpp", 39 ], 40 41 shared_libs: [ 42 "libhwui", 43 "liblog", 44 ], 45 46 header_libs: [ 47 "jni_headers", 48 "native_headers", 49 "libhwui_internal_headers", 50 ], 51 export_header_lib_headers: ["native_headers"], 52 53 static_libs: [ 54 "libarect", 55 ], 56 57 host_supported: true, 58 target: { 59 android: { 60 srcs: [ 61 "aassetstreamadaptor.cpp", 62 "bitmap.cpp", 63 ], 64 shared_libs: [ 65 "libandroid", 66 ], 67 static_libs: [ 68 "libstatslog_hwui", 69 "libstatspull_lazy", 70 "libstatssocket_lazy", 71 ], 72 version_script: "libjnigraphics.map.txt", 73 }, 74 host: { 75 header_libs: [ 76 "libnativewindow_headers", 77 ], 78 }, 79 }, 80 stubs: { 81 symbol_file: "libjnigraphics.map.txt", 82 }, 83} 84 85// The headers module is in frameworks/native/Android.bp. 86ndk_library { 87 name: "libjnigraphics", 88 symbol_file: "libjnigraphics.map.txt", 89 first_version: "9", 90 unversioned_until: "current", 91} 92 93cc_defaults { 94 name: "imagedecoder_fuzzer_defaults", 95 srcs: ["fuzz/fuzz_imagedecoder.cpp"], 96 header_libs: ["jni_headers"], 97 shared_libs: [ 98 "libbinder", 99 "libjnigraphics", 100 "libutils", 101 ], 102 static_libs: ["libarect"], 103 fuzz_config: { 104 cc: [ 105 // Alphabetical order -- assign to skia-android-triage@google.com 106 "danieldilan@google.com", 107 "dichenzhang@google.com", 108 "fmalita@google.com", 109 "jreck@google.com", 110 "nscobie@google.com", 111 "skia-android-triage@google.com", 112 ], 113 asan_options: [ 114 "detect_odr_violation=1", 115 ], 116 hwasan_options: [ 117 // Image decoders may attempt to allocate a large amount of memory 118 // (especially if the encoded image is large). This doesn't 119 // necessarily mean there is a bug. Set allocator_may_return_null=1 120 // for hwasan so the fuzzer can continue running. 121 "allocator_may_return_null = 1", 122 ], 123 }, 124 dictionary: "fuzz/imagedecoder_fuzzer.dict", 125 host_supported: true, 126} 127 128cc_fuzz { 129 name: "imagedecoder_fuzzer", 130 defaults: ["imagedecoder_fuzzer_defaults"], 131 corpus: ["fuzz/corpus/*"], 132} 133 134cc_fuzz { 135 name: "imagedecoder_png_fuzzer", 136 defaults: ["imagedecoder_fuzzer_defaults"], 137 shared_libs: [ 138 "libz", 139 ], 140 cflags: [ 141 "-DPNG_MUTATOR_DEFINE_LIBFUZZER_CUSTOM_MUTATOR", 142 ], 143} 144 145cc_fuzz { 146 name: "imagedecoder_heif_fuzzer", 147 defaults: ["imagedecoder_fuzzer_defaults"], 148 team: "trendy_team_android_core_graphics_stack", 149 shared_libs: [ 150 "libfakeservicemanager", 151 ], 152 target: { 153 android: { 154 shared_libs: [ 155 "libmediaplayerservice", 156 "libmediaextractorservice", 157 ], 158 }, 159 host: { 160 static_libs: [ 161 "libbinder_random_parcel", 162 "libcutils", 163 ], 164 }, 165 }, 166 include_dirs: ["frameworks/av/services/mediaextractor"], 167 cflags: [ 168 "-DFUZZ_HEIF_FORMAT", 169 ], 170} 171