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

libavcodec/svq1dec.c:573:25: Call
571.         if (frame_size_code == 7) {
572.             /* load width, height (12 bits each) */
573.             s->width  = bitstream_read(bc, 12);
                             ^
574.             s->height = bitstream_read(bc, 12);
575. 

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] - 12):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 svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame)\n{\n    SVQ1Context *s = avctx->priv_data;\n    BitstreamContext *bc = &s->bc;\n    int frame_size_code;\n    bitstream_skip(bc, 8);\n    s->nonref = 0;\n    switch (bitstream_read(bc, 2)) {\n    case 0:\n        frame->pict_type = AV_PICTURE_TYPE_I;\n        break;\n    case 2:\n        s->nonref = 1;\n    case 1:\n        frame->pict_type = AV_PICTURE_TYPE_P;\n        break;\n    default:\n        av_log(avctx, AV_LOG_ERROR, "Invalid frame type.\\n");\n        return AVERROR_INVALIDDATA;\n    }\n    if (frame->pict_type == AV_PICTURE_TYPE_I) {\n        if (s->frame_code == 0x50 || s->frame_code == 0x60) {\n            int csum = bitstream_read(bc, 16);\n            csum = ff_svq1_packet_checksum(bc->buffer, bc->size_in_bits >> 3,\n                                           csum);\n            ff_dlog(avctx, "%s checksum (%02x) for packet data\\n",\n                    (csum == 0) ? "correct" : "incorrect", csum);\n        }\n        if ((s->frame_code ^ 0x10) >= 0x50) {\n            uint8_t msg[256];\n            svq1_parse_string(bc, msg);\n            av_log(avctx, AV_LOG_INFO,\n                   "embedded message: \\"%s\\"\\n", (char *)msg);\n        }\n        bitstream_skip(bc, 2);\n        bitstream_skip(bc, 2);\n        bitstream_skip(bc, 1);\n        frame_size_code = bitstream_read(bc, 3);\n        if (frame_size_code == 7) {\n            s->width  = bitstream_read(bc, 12);\n            s->height = bitstream_read(bc, 12);\n            if (!s->width || !s->height)\n                return AVERROR_INVALIDDATA;\n        } else {\n            s->width  = ff_svq1_frame_size_table[frame_size_code][0];\n            s->height = ff_svq1_frame_size_table[frame_size_code][1];\n        }\n    }\n    if (bitstream_read_bit(bc) == 1) {\n        bitstream_skip(bc, 1);\n        bitstream_skip(bc, 1);\n        if (bitstream_read(bc, 2) != 0)\n            return AVERROR_INVALIDDATA;\n    }\n    if (bitstream_read_bit(bc) == 1) {\n        bitstream_skip(bc, 1);\n        bitstream_skip(bc, 4);\n        bitstream_skip(bc, 1);\n        bitstream_skip(bc, 2);\n        while (bitstream_read_bit(bc) == 1)\n            bitstream_skip(bc, 8);\n    }\n    return 0;\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}']