• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2018 Google Inc.
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#
15################################################################################
16FROM gcr.io/oss-fuzz-base/base-builder
17RUN apt-get update && apt-get install -y python3-pip gtk-doc-tools libffi-dev
18RUN pip3 install meson==0.55.3 ninja
19
20RUN git clone --depth 1 https://gitlab.gnome.org/GNOME/gdk-pixbuf.git
21ADD https://ftp.gnome.org/pub/gnome/sources/glib/2.64/glib-2.64.2.tar.xz $SRC
22RUN tar xvJf $SRC/glib-2.64.2.tar.xz
23
24RUN git clone --depth 1 https://github.com/glennrp/libpng.git && \
25    git clone --depth 1 https://github.com/MozillaSecurity/fuzzdata.git && \
26    mkdir corpus && \
27    find $SRC/gdk-pixbuf/tests/ \( -name '*.jpeg' -o -name '*.jpg' -o -name '*.png' \) -exec cp -v '{}' corpus/ ';' && \
28    find $SRC/libpng -name "*.png" | grep -v crashers | xargs cp -t corpus/ && \
29    mv $SRC/fuzzdata/samples/gif/*.gif corpus/ && \
30    zip -q $SRC/gdk-pixbuf_seed_corpus.zip corpus/* && \
31    rm -rf libpng fuzzdata corpus
32
33ADD https://raw.githubusercontent.com/google/fuzzing/master/dictionaries/png.dict $SRC/png.dict
34ADD https://raw.githubusercontent.com/google/fuzzing/master/dictionaries/jpeg.dict $SRC/jpeg.dict
35ADD https://raw.githubusercontent.com/google/fuzzing/master/dictionaries/gif.dict $SRC/gif.dict
36RUN awk 1 $SRC/*.dict > $SRC/gdk-pixbuf.dict && \
37    rm -f $SRC/png.dict $SRC/jpeg.dict $SRC/gif.dict
38
39WORKDIR $SRC/gdk-pixbuf
40COPY targets $SRC/fuzz
41COPY build.sh $SRC/
42