Go to the documentation of this file.
31 static void error(
const char *err)
33 fprintf(stderr,
"%s", err);
39 static const uint64_t
FUZZ_TAG = 0x4741542D5A5A5546ULL;
43 const uint8_t *last =
data;
47 uint64_t keyframes = 0;
48 uint64_t flushpattern = -1;
53 #define BSF_SYMBOL0(BSF) ff_##BSF##_bsf
54 #define BSF_SYMBOL(BSF) BSF_SYMBOL0(BSF)
56 f = &BSF_SYMBOL(FFMPEG_BSF);
63 error(
"Failed memory allocation");
85 extradata_size = bytestream2_get_le32(&gbc);
90 keyframes = bytestream2_get_le64(&gbc);
91 flushpattern = bytestream2_get_le64(&gbc);
92 flags = bytestream2_get_byte(&gbc);
95 if (!strcmp(
f->
name,
"av1_metadata"))
97 else if (!strcmp(
f->
name,
"h264_metadata") || !strcmp(
f->
name,
"h265_metadata"))
99 else if (!strcmp(
f->
name,
"extract_extradata"))
103 if (extradata_size <
size) {
123 error(
"Failed memory allocation");
127 while (
data +
sizeof(fuzz_tag) < end) {
132 if (
data +
sizeof(fuzz_tag) > end)
137 error(
"Failed memory allocation");
140 keyframes = (keyframes >> 2) + (keyframes<<62);
141 data +=
sizeof(fuzz_tag);
144 if (!(flushpattern & 7))
146 flushpattern = (flushpattern >> 3) + (flushpattern << 61);
static void error(const char *err)
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
AVCodecParameters * par_in
Parameters of the input stream.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
#define AV_LOG_PANIC
Something went really wrong and we will crash now.
#define AV_PKT_FLAG_DISCARD
Flag is used to discard packets which are required to maintain valid decoder state but are not requir...
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
int nb_channels
Number of channels in this layout.
void av_bsf_free(AVBSFContext **pctx)
Free a bitstream filter context and everything associated with it; write NULL into the supplied point...
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
The bitstream filter state.
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
void av_bsf_flush(AVBSFContext *ctx)
Reset the internal bitstream filter state.
static const uint64_t FUZZ_TAG
static const AVBitStreamFilter * f
int av_bsf_alloc(const AVBitStreamFilter *filter, AVBSFContext **pctx)
Allocate a context for a given bitstream filter.
enum AVCodecID * codec_ids
A list of codec ids supported by the filter, terminated by AV_CODEC_ID_NONE.
int av_bsf_init(AVBSFContext *ctx)
Prepare the filter for use, after all the parameters and options have been set.
int av_bsf_receive_packet(AVBSFContext *ctx, AVPacket *pkt)
Retrieve a filtered packet.
AVChannelLayout ch_layout
Audio only.
int sample_rate
Audio only.
int av_opt_set_int(void *obj, const char *name, int64_t val, int search_flags)
int extradata_size
Size of the extradata content in bytes.
int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt)
Submit a packet for filtering.
int flags
A combination of AV_PKT_FLAG values.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
void av_log_set_level(int level)
Set the log level.
#define i(width, name, range_min, range_max)
int block_align
Audio only.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
void * priv_data
Opaque filter-specific private data.
int av_bsf_get_null_filter(AVBSFContext **bsf)
Get null/pass-through bitstream filter.
#define AV_INPUT_BUFFER_PADDING_SIZE
const struct AVBitStreamFilter * filter
The bitstream filter this context is an instance of.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
#define flags(name, subs,...)
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
#define FF_SANE_NB_CHANNELS