1/*
2 * Copyright (C) 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
17 */
18
19package {
20    // See: http://go/android-license-faq
21    // A large-scale-change added 'default_applicable_licenses' to import
22    // all of the 'license_kinds' from "frameworks_av_license"
23    // to get the below license kinds:
24    //   SPDX-license-identifier-Apache-2.0
25    default_applicable_licenses: ["frameworks_av_license"],
26}
27
28cc_defaults {
29    name: "C2Fuzzer-defaults",
30
31    defaults: [ "libcodec2-static-defaults" ],
32
33    srcs: [
34        "C2Fuzzer.cpp",
35    ],
36
37    cflags: [
38        "-Wall",
39        "-Werror",
40    ],
41
42    fuzz_config: {
43        cc: [
44            "android-fwk-video@google.com",
45        ],
46        componentid: 1344,
47        hotlists: [
48            "4593311",
49        ],
50        description: "The fuzzer targets the APIs of libcodec2",
51        vector: "remote",
52        service_privilege: "constrained",
53        users: "multi_user",
54        fuzzed_code_usage: "shipped",
55    },
56}
57
58cc_fuzz {
59    name: "C2FuzzerAvcDec",
60    defaults: ["C2Fuzzer-defaults"],
61
62    cflags: [
63        "-DC2COMPONENTNAME=\"c2.android.avc.decoder\"",
64    ],
65
66    static_libs: [
67        "libavcdec",
68        "libcodec2_soft_avcdec",
69    ],
70}
71
72cc_fuzz {
73    name: "C2FuzzerHevcDec",
74    defaults: ["C2Fuzzer-defaults"],
75
76    cflags: [
77        "-DC2COMPONENTNAME=\"c2.android.hevc.decoder\"",
78    ],
79
80    static_libs: [
81        "libhevcdec",
82        "libcodec2_soft_hevcdec",
83    ],
84}
85
86cc_fuzz {
87    name: "C2FuzzerMpeg2Dec",
88    defaults: ["C2Fuzzer-defaults"],
89
90    cflags: [
91        "-DC2COMPONENTNAME=\"c2.android.mpeg2.decoder\"",
92    ],
93
94    static_libs: [
95        "libmpeg2dec",
96        "libcodec2_soft_mpeg2dec",
97    ],
98}
99
100cc_fuzz {
101    name: "C2FuzzerMpeg4Dec",
102    defaults: ["C2Fuzzer-defaults"],
103
104    cflags: [
105        "-DC2COMPONENTNAME=\"c2.android.mpeg4.decoder\"",
106    ],
107
108    static_libs: [
109        "libstagefright_m4vh263dec",
110        "libcodec2_soft_mpeg4dec",
111    ],
112}
113
114cc_fuzz {
115    name: "C2FuzzerH263Dec",
116    defaults: ["C2Fuzzer-defaults"],
117
118    cflags: [
119        "-DC2COMPONENTNAME=\"c2.android.h263.decoder\"",
120    ],
121
122    static_libs: [
123        "libstagefright_m4vh263dec",
124        "libcodec2_soft_h263dec",
125    ],
126}
127
128cc_fuzz {
129    name: "C2FuzzerVp8Dec",
130    defaults: ["C2Fuzzer-defaults"],
131
132    cflags: [
133        "-DC2COMPONENTNAME=\"c2.android.vp8.decoder\"",
134    ],
135
136    static_libs: [
137        "libvpx",
138        "libcodec2_soft_vp8dec",
139    ],
140}
141
142cc_fuzz {
143    name: "C2FuzzerVp9Dec",
144    defaults: ["C2Fuzzer-defaults"],
145
146    cflags: [
147        "-DC2COMPONENTNAME=\"c2.android.vp9.decoder\"",
148    ],
149
150    static_libs: [
151        "libvpx",
152        "libcodec2_soft_vp9dec",
153    ],
154}
155
156cc_fuzz {
157    name: "C2FuzzerAV1Dec",
158    defaults: ["C2Fuzzer-defaults"],
159
160    cflags: [
161        "-DC2COMPONENTNAME=\"c2.android.av1.decoder\"",
162    ],
163
164    static_libs: [
165        "libgav1",
166        "libyuv",
167        "libcodec2_soft_av1dec_gav1",
168    ],
169}
170
171cc_fuzz {
172    name: "C2FuzzerAacDec",
173    defaults: ["C2Fuzzer-defaults"],
174
175    cflags: [
176        "-DC2COMPONENTNAME=\"c2.android.aac.decoder\"",
177    ],
178
179    static_libs: [
180        "libFraunhoferAAC",
181        "libcodec2_soft_aacdec",
182    ],
183}
184
185cc_fuzz {
186    name: "C2FuzzerAmrnbDec",
187    defaults: ["C2Fuzzer-defaults"],
188
189    cflags: [
190        "-DC2COMPONENTNAME=\"c2.android.amrnb.decoder\"",
191    ],
192
193    static_libs: [
194        "libstagefright_amrnbdec",
195        "libstagefright_amrwbdec",
196        "libstagefright_amrnb_common",
197        "libcodec2_soft_amrnbdec",
198    ],
199}
200
201cc_fuzz {
202    name: "C2FuzzerAmrwbDec",
203    defaults: ["C2Fuzzer-defaults"],
204
205    cflags: [
206        "-DC2COMPONENTNAME=\"c2.android.amrwb.decoder\"",
207    ],
208
209    static_libs: [
210        "libstagefright_amrnbdec",
211        "libstagefright_amrwbdec",
212        "libstagefright_amrnb_common",
213        "libcodec2_soft_amrwbdec",
214    ],
215}
216
217cc_fuzz {
218    name: "C2FuzzerFlacDec",
219    defaults: ["C2Fuzzer-defaults"],
220
221    cflags: [
222        "-DC2COMPONENTNAME=\"c2.android.flac.decoder\"",
223    ],
224
225    static_libs: [
226        "libFLAC",
227        "libstagefright_flacdec",
228        "libcodec2_soft_flacdec",
229    ],
230}
231
232cc_fuzz {
233    name: "C2FuzzerG711AlawDec",
234    defaults: ["C2Fuzzer-defaults"],
235
236    cflags: [
237        "-DC2COMPONENTNAME=\"c2.android.g711.alaw.decoder\"",
238    ],
239
240    static_libs: [
241        "codecs_g711dec",
242        "libcodec2_soft_g711alawdec",
243    ],
244}
245
246cc_fuzz {
247    name: "C2FuzzerG711MlawDec",
248    defaults: ["C2Fuzzer-defaults"],
249
250    cflags: [
251        "-DC2COMPONENTNAME=\"c2.android.g711.mlaw.decoder\"",
252    ],
253
254    static_libs: [
255        "codecs_g711dec",
256        "libcodec2_soft_g711mlawdec",
257    ],
258}
259
260cc_fuzz {
261    name: "C2FuzzerGsmDec",
262    defaults: ["C2Fuzzer-defaults"],
263
264    cflags: [
265        "-DC2COMPONENTNAME=\"c2.android.gsm.decoder\"",
266    ],
267
268    static_libs: [
269        "libgsm",
270        "libcodec2_soft_gsmdec",
271    ],
272}
273
274cc_fuzz {
275    name: "C2FuzzerMp3Dec",
276    defaults: ["C2Fuzzer-defaults"],
277
278    cflags: [
279        "-DC2COMPONENTNAME=\"c2.android.mp3.decoder\"",
280    ],
281
282    static_libs: [
283        "libstagefright_mp3dec",
284        "libcodec2_soft_mp3dec",
285    ],
286}
287
288cc_fuzz {
289    name: "C2FuzzerOpusDec",
290    defaults: ["C2Fuzzer-defaults"],
291
292    cflags: [
293        "-DC2COMPONENTNAME=\"c2.android.opus.decoder\"",
294    ],
295
296    static_libs: [
297        "libopus",
298        "libcodec2_soft_opusdec",
299    ],
300}
301
302cc_fuzz {
303    name: "C2FuzzerRawDec",
304    defaults: ["C2Fuzzer-defaults"],
305
306    cflags: [
307        "-DC2COMPONENTNAME=\"c2.android.raw.decoder\"",
308    ],
309
310    static_libs: [
311        "libcodec2_soft_rawdec",
312    ],
313}
314
315cc_fuzz {
316    name: "C2FuzzerVorbisDec",
317    defaults: ["C2Fuzzer-defaults"],
318
319    cflags: [
320        "-DC2COMPONENTNAME=\"c2.android.vorbis.decoder\"",
321    ],
322
323    static_libs: [
324        "libvorbisidec",
325        "libcodec2_soft_vorbisdec",
326    ],
327}
328
329cc_fuzz {
330    name: "C2FuzzerXaacDec",
331    defaults: ["C2Fuzzer-defaults"],
332
333    cflags: [
334        "-DC2COMPONENTNAME=\"c2.android.xaac.decoder\"",
335    ],
336
337    static_libs: [
338        "libxaacdec",
339        "libcodec2_soft_xaacdec",
340    ],
341}
342