30 #define MAX_TRUNC_PICTURE_SIZE (500 * 1024 * 1024)
42 uint32_t
len, left, trunclen = 0;
54 type = bytestream2_get_be32u(&
g);
64 len = bytestream2_get_be32u(&
g);
65 if (len <= 0 || len >=
sizeof(mimetype)) {
82 if (!strncmp(mime->
str, mimetype,
sizeof(mimetype))) {
97 len = bytestream2_get_be32u(&
g);
114 width = bytestream2_get_be32u(&
g);
115 height = bytestream2_get_be32u(&
g);
119 len = bytestream2_get_be32u(&
g);
122 if (len <= 0 || len > left) {
133 if (truncate_workaround &&
135 len > left && (
len & 0xffffff) == left) {
137 trunclen =
len - left;
#define AV_EF_EXPLODE
abort decoding on minor error detection
#define FF_COMPLIANCE_NORMAL
#define RETURN_ERROR(code)
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
static av_always_inline void bytestream2_skipu(GetByteContext *g, unsigned int size)
static av_always_inline unsigned int bytestream2_get_bufferu(GetByteContext *g, uint8_t *dst, unsigned int size)
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
#define MAX_TRUNC_PICTURE_SIZE
int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size, int truncate_workaround)
AVCodecID
Identify the syntax and semantics of the bitstream.
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
AVBufferRef * av_buffer_alloc(buffer_size_t size)
Allocate an AVBuffer of the given size using av_malloc().
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_INFO
Standard information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char *const ff_id3v2_picture_types[21]
const CodecMime ff_id3v2_mime_tags[]
common internal API header
#define FF_ARRAY_ELEMS(a)
A reference to a data buffer.
enum AVMediaType codec_type
General type of the encoded data.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
AVBufferRef * buf
A reference to the reference-counted buffer where the packet data is stored.
int flags
A combination of AV_PKT_FLAG values.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int index
stream index in AVFormatContext
AVPacket attached_pic
For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet will contain the attached pictu...
int disposition
AV_DISPOSITION_* bit field.