From 4116e9b5ac862f2c660712e26f0327526e7ee6ee Mon Sep 17 00:00:00 2001 From: manunio Date: Thu, 7 Dec 2023 04:31:40 +0530 Subject: [PATCH] pdf-js: initial integration (#11270) [PDF.js](https://mozilla.github.io/pdf.js/) is a Portable Document Format (PDF) viewer that is built with HTML5. - It has `44.6k` stars on github. - PDF.js is built into version 19+ of Firefox. - Available as extension for Chrome at [Chrome Web Store](https://chrome.google.com/webstore/detail/pdf-viewer/oemmndcbldboiebfnladdacbdfmadadm) --- projects/pdf-js/Dockerfile | 21 +++++++++++++++++++++ projects/pdf-js/build.sh | 25 +++++++++++++++++++++++++ projects/pdf-js/project.yaml | 10 ++++++++++ 3 files changed, 56 insertions(+) create mode 100644 projects/pdf-js/Dockerfile create mode 100755 projects/pdf-js/build.sh create mode 100644 projects/pdf-js/project.yaml diff --git a/projects/pdf-js/Dockerfile b/projects/pdf-js/Dockerfile new file mode 100644 index 000000000..405d22151 --- /dev/null +++ b/projects/pdf-js/Dockerfile @@ -0,0 +1,21 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +FROM gcr.io/oss-fuzz-base/base-builder-javascript +RUN apt-get update && apt-get install -y make autoconf automake libtool +RUN git clone --depth 1 https://github.com/mozilla/pdf.js pdf-js +WORKDIR pdf-js +COPY build.sh $SRC/ diff --git a/projects/pdf-js/build.sh b/projects/pdf-js/build.sh new file mode 100755 index 000000000..d26e856ef --- /dev/null +++ b/projects/pdf-js/build.sh @@ -0,0 +1,25 @@ +#!/bin/bash -eu +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +npm install --save-dev @jazzer.js/core +npm install -g gulp-cli + +gulp image_decoders + +compile_javascript_fuzzer pdf-js test/fuzz/jpeg_image.fuzz --sync +compile_javascript_fuzzer pdf-js test/fuzz/jbig2_image.fuzz --sync +compile_javascript_fuzzer pdf-js test/fuzz/jpx_image.fuzz --sync diff --git a/projects/pdf-js/project.yaml b/projects/pdf-js/project.yaml new file mode 100644 index 000000000..c5075fa9f --- /dev/null +++ b/projects/pdf-js/project.yaml @@ -0,0 +1,10 @@ +homepage: "https://github.com/mozilla/pdf.js" +language: javascript +primary_contact: "mcastelluccio@mozilla.com" +main_repo: "https://github.com/mozilla/pdf.js" +vendor_ccs: + - maxnair.dev@gmail.com +fuzzing_engines: + - libfuzzer +sanitizers: + - none