]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/brstm.c
avutil/hwcontext_vulkan: fix format specifiers for some printed variables
[ffmpeg] / libavformat / brstm.c
index c4230a63bf385974672449b73a230a713c1783e9..f1f0f86ed50f450f090a84bc8fd7d37aa29d9934 100644 (file)
@@ -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) ||
@@ -490,7 +481,7 @@ static int read_seek(AVFormatContext *s, int stream_index,
     return 0;
 }
 
-AVInputFormat ff_brstm_demuxer = {
+const AVInputFormat ff_brstm_demuxer = {
     .name           = "brstm",
     .long_name      = NULL_IF_CONFIG_SMALL("BRSTM (Binary Revolution Stream)"),
     .priv_data_size = sizeof(BRSTMDemuxContext),
@@ -502,7 +493,7 @@ AVInputFormat ff_brstm_demuxer = {
     .extensions     = "brstm",
 };
 
-AVInputFormat ff_bfstm_demuxer = {
+const AVInputFormat ff_bfstm_demuxer = {
     .name           = "bfstm",
     .long_name      = NULL_IF_CONFIG_SMALL("BFSTM (Binary Cafe Stream)"),
     .priv_data_size = sizeof(BRSTMDemuxContext),