summaryrefslogtreecommitdiff
path: root/libavformat/brstm.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2020-09-12 14:49:15 +0200
committerPaul B Mahol <onemda@gmail.com>2020-09-12 14:52:31 +0200
commit60c4459075c947244961dac5d372ab6bd6591ac2 (patch)
tree3a32468e953e0ca7f66d9ea96a6173d614a0e98b /libavformat/brstm.c
parent3382b0290a31a9e462d3f19e9590fa091b23fd4f (diff)
downloadffmpeg-60c4459075c947244961dac5d372ab6bd6591ac2.tar.gz
avformat/brstm: remove custom allocation of table to hold coeffs
Diffstat (limited to 'libavformat/brstm.c')
-rw-r--r--libavformat/brstm.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/libavformat/brstm.c b/libavformat/brstm.c
index c4230a63bf..6754c1712e 100644
--- a/libavformat/brstm.c
+++ b/libavformat/brstm.c
@@ -38,7 +38,7 @@ typedef struct BRSTMDemuxContext {
uint32_t last_block_size;
uint32_t last_block_samples;
uint32_t data_start;
- uint8_t *table;
+ uint8_t table[256 * 32];
uint8_t *adpc;
BRSTMCoeffOffset offsets[256];
int little_endian;
@@ -67,7 +67,6 @@ static int read_close(AVFormatContext *s)
{
BRSTMDemuxContext *b = s->priv_data;
- av_freep(&b->table);
av_freep(&b->adpc);
return 0;
@@ -284,9 +283,6 @@ static int read_header(AVFormatContext *s)
}
avio_skip(s->pb, pos + toffset - avio_tell(s->pb));
- b->table = av_mallocz(32 * st->codecpar->channels);
- if (!b->table)
- return AVERROR(ENOMEM);
for (ch = 0; ch < st->codecpar->channels; ch++) {
if (!bfstm)
@@ -422,11 +418,6 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
av_log(s, AV_LOG_ERROR, "adpcm_thp requires ADPC chunk, but none was found.\n");
return AVERROR_INVALIDDATA;
}
- if (!b->table) {
- b->table = av_mallocz(32 * par->channels);
- if (!b->table)
- return AVERROR(ENOMEM);
- }
if (size > (INT_MAX - 32 - 4) ||
(32 + 4 + size) > (INT_MAX / par->channels) ||