]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mpc7.c
adpcm: Add missing stdint.h #include to fix standalone header compilation.
[ffmpeg] / libavcodec / mpc7.c
index 290ecfb385f47f48f6ea4b713eee6d383fceebc8..6b6bffe357e8e5c63e8c879c3adfc7e02d54e618 100644 (file)
@@ -53,7 +53,7 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx)
     int i, j;
     MPCContext *c = avctx->priv_data;
     GetBitContext gb;
-    uint8_t buf[16];
+    LOCAL_ALIGNED_16(uint8_t, buf, [16]);
     static int vlc_initialized = 0;
 
     static VLC_TYPE scfi_table[1 << MPC7_SCFI_BITS][2];
@@ -224,6 +224,8 @@ static int mpc7_decode_frame(AVCodecContext * avctx, void *data,
     }
 
     bits = av_malloc(((buf_size - 1) & ~3) + FF_INPUT_BUFFER_PADDING_SIZE);
+    if (!bits)
+        return AVERROR(ENOMEM);
     c->dsp.bswap_buf((uint32_t*)bits, (const uint32_t*)(buf + 4), (buf_size - 4) >> 2);
     init_get_bits(&gb, bits, (buf_size - 4)* 8);
     skip_bits_long(&gb, buf[0]);