MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / ebml_read_binary

Function ebml_read_binary

libavformat/matroskadec.c:1086–1107  ·  view source on GitHub ↗

* Read the next element as binary data. * 0 is success, < 0 or NEEDS_CHECKING is failure. */

Source from the content-addressed store, hash-verified

1084 * 0 is success, < 0 or NEEDS_CHECKING is failure.
1085 */
1086static int ebml_read_binary(AVIOContext *pb, int length,
1087 int64_t pos, EbmlBin *bin)
1088{
1089 int ret;
1090
1091 ret = av_buffer_realloc(&bin->buf, length + AV_INPUT_BUFFER_PADDING_SIZE);
1092 if (ret < 0)
1093 return ret;
1094 memset(bin->buf->data + length, 0, AV_INPUT_BUFFER_PADDING_SIZE);
1095
1096 bin->data = bin->buf->data;
1097 bin->size = length;
1098 bin->pos = pos;
1099 if ((ret = avio_read(pb, bin->data, length)) != length) {
1100 av_buffer_unref(&bin->buf);
1101 bin->data = NULL;
1102 bin->size = 0;
1103 return ret < 0 ? ret : NEEDS_CHECKING;
1104 }
1105
1106 return 0;
1107}
1108
1109/*
1110 * Read the next element, but only the header. The contents

Callers 1

ebml_parseFunction · 0.85

Calls 3

av_buffer_reallocFunction · 0.85
avio_readFunction · 0.85
av_buffer_unrefFunction · 0.85

Tested by

no test coverage detected