libavformat/ipmovie.c:146: error: Integer Overflow L1
  ([-12+max(-6, `s->audio_chunk_size`), -6+min(-12, `s->audio_chunk_size`)] - `s->audio_channels`):unsigned32.

libavformat/ipmovie.c:114:1: <LHS trace>
112. } IPMVEContext;
113. 
114. static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
     ^
115.     AVPacket *pkt) {
116. 

libavformat/ipmovie.c:114:1: Parameter `s->audio_chunk_size`
112. } IPMVEContext;
113. 
114. static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
     ^
115.     AVPacket *pkt) {
116. 

libavformat/ipmovie.c:114:1: <RHS trace>
112. } IPMVEContext;
113. 
114. static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
     ^
115.     AVPacket *pkt) {
116. 

libavformat/ipmovie.c:114:1: Parameter `s->audio_channels`
112. } IPMVEContext;
113. 
114. static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
     ^
115.     AVPacket *pkt) {
116. 

libavformat/ipmovie.c:146:13: Binary operation: ([-12+max(-6, s->audio_chunk_size), -6+min(-12, s->audio_chunk_size)] - s->audio_channels):unsigned32
144.             (s->audio_chunk_size / s->audio_channels / (s->audio_bits / 8));
145.         else
146.             s->audio_frame_count +=
                 ^
147.                 (s->audio_chunk_size - 6 - s->audio_channels) / s->audio_channels;
148. 

static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
    AVPacket *pkt) {
    int chunk_type;
    if (s->audio_chunk_offset) {
        if (s->audio_type == CODEC_ID_NONE) {
            av_log(NULL, AV_LOG_ERROR, "Can not read audio packet before"
                   "audio codec is known\n");
                return CHUNK_BAD;
        }
        if (s->audio_type != CODEC_ID_INTERPLAY_DPCM) {
            s->audio_chunk_offset += 6;
            s->audio_chunk_size -= 6;
        }
        avio_seek(pb, s->audio_chunk_offset, SEEK_SET);
        s->audio_chunk_offset = 0;
        if (s->audio_chunk_size != av_get_packet(pb, pkt, s->audio_chunk_size))
            return CHUNK_EOF;
        pkt->stream_index = s->audio_stream_index;
        pkt->pts = s->audio_frame_count;
        if (s->audio_type != CODEC_ID_INTERPLAY_DPCM)
            s->audio_frame_count +=
            (s->audio_chunk_size / s->audio_channels / (s->audio_bits / 8));
        else
            s->audio_frame_count +=
                (s->audio_chunk_size - 6 - s->audio_channels) / s->audio_channels;
        av_dlog(NULL, "sending audio frame with pts %"PRId64" (%d audio frames)\n",
                pkt->pts, s->audio_frame_count);
        chunk_type = CHUNK_VIDEO;
    } else if (s->decode_map_chunk_offset) {
        if (av_new_packet(pkt, s->decode_map_chunk_size + s->video_chunk_size))
            return CHUNK_NOMEM;
        if (s->has_palette) {
            uint8_t *pal;
            pal = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE,
                                          AVPALETTE_SIZE);
            if (pal) {
                memcpy(pal, s->palette, AVPALETTE_SIZE);
                s->has_palette = 0;
            }
        }
        if (s->changed) {
            ff_add_param_change(pkt, 0, 0, 0, s->video_width, s->video_height);
            s->changed = 0;
        }
        pkt->pos= s->decode_map_chunk_offset;
        avio_seek(pb, s->decode_map_chunk_offset, SEEK_SET);
        s->decode_map_chunk_offset = 0;
        if (avio_read(pb, pkt->data, s->decode_map_chunk_size) !=
            s->decode_map_chunk_size) {
            av_free_packet(pkt);
            return CHUNK_EOF;
        }
        avio_seek(pb, s->video_chunk_offset, SEEK_SET);
        s->video_chunk_offset = 0;
        if (avio_read(pb, pkt->data + s->decode_map_chunk_size,
            s->video_chunk_size) != s->video_chunk_size) {
            av_free_packet(pkt);
            return CHUNK_EOF;
        }
        pkt->stream_index = s->video_stream_index;
        pkt->pts = s->video_pts;
        av_dlog(NULL, "sending video frame with pts %"PRId64"\n", pkt->pts);
        s->video_pts += s->frame_pts_inc;
        chunk_type = CHUNK_VIDEO;
    } else {
        avio_seek(pb, s->next_chunk_offset, SEEK_SET);
        chunk_type = CHUNK_DONE;
    }
    return chunk_type;
}
['static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,\n    AVPacket *pkt) {\n    int chunk_type;\n    if (s->audio_chunk_offset) {\n        if (s->audio_type == CODEC_ID_NONE) {\n            av_log(NULL, AV_LOG_ERROR, "Can not read audio packet before"\n                   "audio codec is known\\n");\n                return CHUNK_BAD;\n        }\n        if (s->audio_type != CODEC_ID_INTERPLAY_DPCM) {\n            s->audio_chunk_offset += 6;\n            s->audio_chunk_size -= 6;\n        }\n        avio_seek(pb, s->audio_chunk_offset, SEEK_SET);\n        s->audio_chunk_offset = 0;\n        if (s->audio_chunk_size != av_get_packet(pb, pkt, s->audio_chunk_size))\n            return CHUNK_EOF;\n        pkt->stream_index = s->audio_stream_index;\n        pkt->pts = s->audio_frame_count;\n        if (s->audio_type != CODEC_ID_INTERPLAY_DPCM)\n            s->audio_frame_count +=\n            (s->audio_chunk_size / s->audio_channels / (s->audio_bits / 8));\n        else\n            s->audio_frame_count +=\n                (s->audio_chunk_size - 6 - s->audio_channels) / s->audio_channels;\n        av_dlog(NULL, "sending audio frame with pts %"PRId64" (%d audio frames)\\n",\n                pkt->pts, s->audio_frame_count);\n        chunk_type = CHUNK_VIDEO;\n    } else if (s->decode_map_chunk_offset) {\n        if (av_new_packet(pkt, s->decode_map_chunk_size + s->video_chunk_size))\n            return CHUNK_NOMEM;\n        if (s->has_palette) {\n            uint8_t *pal;\n            pal = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE,\n                                          AVPALETTE_SIZE);\n            if (pal) {\n                memcpy(pal, s->palette, AVPALETTE_SIZE);\n                s->has_palette = 0;\n            }\n        }\n        if (s->changed) {\n            ff_add_param_change(pkt, 0, 0, 0, s->video_width, s->video_height);\n            s->changed = 0;\n        }\n        pkt->pos= s->decode_map_chunk_offset;\n        avio_seek(pb, s->decode_map_chunk_offset, SEEK_SET);\n        s->decode_map_chunk_offset = 0;\n        if (avio_read(pb, pkt->data, s->decode_map_chunk_size) !=\n            s->decode_map_chunk_size) {\n            av_free_packet(pkt);\n            return CHUNK_EOF;\n        }\n        avio_seek(pb, s->video_chunk_offset, SEEK_SET);\n        s->video_chunk_offset = 0;\n        if (avio_read(pb, pkt->data + s->decode_map_chunk_size,\n            s->video_chunk_size) != s->video_chunk_size) {\n            av_free_packet(pkt);\n            return CHUNK_EOF;\n        }\n        pkt->stream_index = s->video_stream_index;\n        pkt->pts = s->video_pts;\n        av_dlog(NULL, "sending video frame with pts %"PRId64"\\n", pkt->pts);\n        s->video_pts += s->frame_pts_inc;\n        chunk_type = CHUNK_VIDEO;\n    } else {\n        avio_seek(pb, s->next_chunk_offset, SEEK_SET);\n        chunk_type = CHUNK_DONE;\n    }\n    return chunk_type;\n}']