RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1
/*
2
RawSpeed - RAW file decoder.
3
4
Copyright (C) 2017 Roman Lebedev
5
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Lesser General Public
8
License as published by the Free Software Foundation; either
9
version 2 of the License, or (at your option) any later version.
10
11
This library is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Lesser General Public License for more details.
15
16
You should have received a copy of the GNU Lesser General Public
17
License along with this library; if not, write to the Free Software
18
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
21
#include "
RawSpeed-API.h
"
22
#include "
adt/Casts.h
"
23
#include <cstddef>
24
#include <cstdint>
25
#include <memory>
26
27
static
const
rawspeed::CameraMetaData
metadata
{};
28
29
extern
"C"
int
LLVMFuzzerTestOneInput
(
const
uint8_t* Data,
size_t
Size);
30
31
extern
"C"
int
LLVMFuzzerTestOneInput
(
const
uint8_t* Data,
size_t
Size) {
32
// static const CameraMetaData metadata(RAWSPEED_SOURCE_DIR
33
// "/data/cameras.xml");
34
35
try
{
36
const
rawspeed::Buffer
buffer(
37
Data,
rawspeed::implicit_cast<rawspeed::Buffer::size_type>
(Size));
38
rawspeed::RawParser
parser(buffer);
39
auto
decoder = parser.
getDecoder
(
/*&metadata*/
);
40
41
decoder->applyCrop =
false
;
42
decoder->interpolateBadPixels =
false
;
43
decoder->failOnUnknown =
false
;
44
// decoder->checkSupport(&metadata);
45
46
decoder->decodeRaw();
47
decoder->decodeMetaData(&
metadata
);
48
}
catch
(
const
rawspeed::RawspeedException
&) {
49
return
0;
50
}
51
52
return
0;
53
}
Casts.h
RawSpeed-API.h
rawspeed::Buffer
Definition
Buffer.h:47
rawspeed::CameraMetaData
Definition
CameraMetaData.h:47
rawspeed::RawParser
Definition
RawParser.h:31
rawspeed::RawParser::getDecoder
virtual std::unique_ptr< RawDecoder > getDecoder(const CameraMetaData *meta=nullptr)
Definition
RawParser.cpp:42
rawspeed::RawspeedException
Definition
RawspeedException.h:56
LLVMFuzzerTestOneInput
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
Definition
main.cpp:60
metadata
static const rawspeed::CameraMetaData metadata
Definition
main.cpp:54
rawspeed::implicit_cast
constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value)
Definition
Casts.h:32
fuzz
rawspeed
main.cpp
Generated by
1.15.0