libavcodec/ralf.c:488: error: Integer Overflow L2
  ([1, +oo] - 9):unsigned32 by call to `bitstream_read`.

libavcodec/ralf.c:488:47: Call
486.         ctx->block_size[ctx->num_blocks] = bitstream_read(&bc, 15);
487.         if (bitstream_read_bit(&bc)) {
488.             ctx->block_pts[ctx->num_blocks] = bitstream_read(&bc, 9);
                                                   ^
489.         } else {
490.             ctx->block_pts[ctx->num_blocks] = 0;

libavcodec/bitstream.h:183:1: Parameter `n`
  181. 
  182. /* Return n bits from the buffer. n has to be in the 0-32 range. */
  183. static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n)
       ^
  184. {
  185.     if (!n)

libavcodec/bitstream.h:194:12: Call
  192.     }
  193. 
  194.     return get_val(bc, n);
                  ^
  195. }
  196. 

libavcodec/bitstream.h:130:1: <LHS trace>
128. }
129. 
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
     ^
131. {
132. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:130:1: Parameter `bc->bits_left`
    128. }
    129. 
    130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
         ^
    131. {
    132. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:130:1: <RHS trace>
128. }
129. 
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
     ^
131. {
132. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:130:1: Parameter `n`
    128. }
    129. 
    130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
         ^
    131. {
    132. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:139:5: Binary operation: ([1, +oo] - 9):unsigned32 by call to `bitstream_read` 
    137.     bc->bits <<= n;
    138. #endif
    139.     bc->bits_left -= n;
             ^
    140. 
    141.     return ret;

static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
{
#ifdef BITSTREAM_READER_LE
    uint64_t ret = bc->bits & ((UINT64_C(1) << n) - 1);
    bc->bits >>= n;
#else
    uint64_t ret = bc->bits >> (64 - n);
    bc->bits <<= n;
#endif
    bc->bits_left -= n;
    return ret;
}
['static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,\n                        AVPacket *avpkt)\n{\n    RALFContext *ctx = avctx->priv_data;\n    AVFrame *frame   = data;\n    int16_t *samples0;\n    int16_t *samples1;\n    int ret;\n    BitstreamContext bc;\n    int table_size, table_bytes, i;\n    const uint8_t *src, *block_pointer;\n    int src_size;\n    int bytes_left;\n    if (ctx->has_pkt) {\n        ctx->has_pkt = 0;\n        table_bytes = (AV_RB16(avpkt->data) + 7) >> 3;\n        if (table_bytes + 3 > avpkt->size || avpkt->size > RALF_MAX_PKT_SIZE) {\n            av_log(avctx, AV_LOG_ERROR, "Wrong packet\'s breath smells of wrong data!\\n");\n            return AVERROR_INVALIDDATA;\n        }\n        if (memcmp(ctx->pkt, avpkt->data, 2 + table_bytes)) {\n            av_log(avctx, AV_LOG_ERROR, "Wrong packet tails are wrong!\\n");\n            return AVERROR_INVALIDDATA;\n        }\n        src      = ctx->pkt;\n        src_size = RALF_MAX_PKT_SIZE + avpkt->size;\n        memcpy(ctx->pkt + RALF_MAX_PKT_SIZE, avpkt->data + 2 + table_bytes,\n               avpkt->size - 2 - table_bytes);\n    } else {\n        if (avpkt->size == RALF_MAX_PKT_SIZE) {\n            memcpy(ctx->pkt, avpkt->data, avpkt->size);\n            ctx->has_pkt   = 1;\n            *got_frame_ptr = 0;\n            return avpkt->size;\n        }\n        src      = avpkt->data;\n        src_size = avpkt->size;\n    }\n    frame->nb_samples = ctx->max_frame_size;\n    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {\n        av_log(avctx, AV_LOG_ERROR, "Me fail get_buffer()? That\'s unpossible!\\n");\n        return ret;\n    }\n    samples0 = (int16_t *)frame->data[0];\n    samples1 = (int16_t *)frame->data[1];\n    if (src_size < 5) {\n        av_log(avctx, AV_LOG_ERROR, "too short packets are too short!\\n");\n        return AVERROR_INVALIDDATA;\n    }\n    table_size  = AV_RB16(src);\n    table_bytes = (table_size + 7) >> 3;\n    if (src_size < table_bytes + 3) {\n        av_log(avctx, AV_LOG_ERROR, "short packets are short!\\n");\n        return AVERROR_INVALIDDATA;\n    }\n    bitstream_init(&bc, src + 2, table_size);\n    ctx->num_blocks = 0;\n    while (bitstream_bits_left(&bc) > 0) {\n        ctx->block_size[ctx->num_blocks] = bitstream_read(&bc, 15);\n        if (bitstream_read_bit(&bc)) {\n            ctx->block_pts[ctx->num_blocks] = bitstream_read(&bc, 9);\n        } else {\n            ctx->block_pts[ctx->num_blocks] = 0;\n        }\n        ctx->num_blocks++;\n    }\n    block_pointer = src      + table_bytes + 2;\n    bytes_left    = src_size - table_bytes - 2;\n    ctx->sample_offset = 0;\n    for (i = 0; i < ctx->num_blocks; i++) {\n        if (bytes_left < ctx->block_size[i]) {\n            av_log(avctx, AV_LOG_ERROR, "I\'m pedaling backwards\\n");\n            break;\n        }\n        bitstream_init8(&bc, block_pointer, ctx->block_size[i]);\n        if (decode_block(avctx, &bc, samples0 + ctx->sample_offset,\n                                     samples1 + ctx->sample_offset) < 0) {\n            av_log(avctx, AV_LOG_ERROR, "Sir, I got carsick in your office. Not decoding the rest of packet.\\n");\n            break;\n        }\n        block_pointer += ctx->block_size[i];\n        bytes_left    -= ctx->block_size[i];\n    }\n    frame->nb_samples = ctx->sample_offset;\n    *got_frame_ptr    = ctx->sample_offset > 0;\n    return avpkt->size;\n}', 'static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n)\n{\n    if (!n)\n        return 0;\n    if (n > bc->bits_left) {\n        refill_32(bc);\n        if (bc->bits_left < 32)\n            bc->bits_left = n;\n    }\n    return get_val(bc, n);\n}', 'static inline uint64_t get_val(BitstreamContext *bc, unsigned n)\n{\n#ifdef BITSTREAM_READER_LE\n    uint64_t ret = bc->bits & ((UINT64_C(1) << n) - 1);\n    bc->bits >>= n;\n#else\n    uint64_t ret = bc->bits >> (64 - n);\n    bc->bits <<= n;\n#endif\n    bc->bits_left -= n;\n    return ret;\n}']