32#define MAX_TRUNC_PICTURE_SIZE (500 * 1024 * 1024)
35 int truncate_workaround)
40 uint8_t mimetype[64], *buf = *bufp;
46 uint32_t
len,
left, trunclen = 0;
58 type = bytestream2_get_be32u(&
g);
68 len = bytestream2_get_be32u(&
g);
86 if (!strncmp(mime->
str, mimetype,
sizeof(mimetype))) {
99 len = bytestream2_get_be32u(&
g);
112 width = bytestream2_get_be32u(&
g);
113 ((uint8_t*)
g.buffer)[-4] =
'\0';
114 height = bytestream2_get_be32u(&
g);
118 len = bytestream2_get_be32u(&
g);
132 if (truncate_workaround &&
144 if (trunclen == 0 &&
len >= buf_size - (buf_size >> 4)) {
176 st =
s->streams[
s->nb_streams - 1];
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
static int BS_FUNC left(const BSCTX *bc)
Return the number of the bits left in a buffer.
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(const GetByteContext *g)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static av_always_inline int bytestream2_tell(const GetByteContext *g)
#define AV_EF_EXPLODE
abort decoding on minor error detection
#define FF_COMPLIANCE_NORMAL
int ff_add_attached_pic(AVFormatContext *s, AVStream *st, AVIOContext *pb, AVBufferRef **buf, int size)
Add an attached pic to an AVStream.
#define MAX_TRUNC_PICTURE_SIZE
int ff_flac_parse_picture(AVFormatContext *s, uint8_t **bufp, int buf_size, int truncate_workaround)
Parse a FLAC METADATA_BLOCK_PICTURE.
#define RETURN_ERROR(code)
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_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
void av_buffer_default_free(void *opaque, uint8_t *data)
Default free callback, which calls av_free() on the buffer data.
AVBufferRef * av_buffer_alloc(size_t size)
Allocate an AVBuffer of the given size using av_malloc().
AVBufferRef * av_buffer_create(uint8_t *data, size_t size, void(*free)(void *opaque, uint8_t *data), void *opaque, int flags)
Create an AVBuffer from an existing array.
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_WARNING
Something somehow does not look correct.
#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[]
#define FF_ARRAY_ELEMS(a)
A reference to a data buffer.
int height
The height of the video frame in pixels.
int width
The width of the video frame in pixels.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
AVCodecParameters * codecpar
Codec parameters associated with this stream.