Revision fea714ec

View differences:

libavcodec/dpx.c
55 55
                        AVPacket *avpkt)
56 56
{
57 57
    const uint8_t *buf = avpkt->data;
58
    const uint8_t *buf_end = avpkt->data + avpkt->size;
58 59
    int buf_size       = avpkt->size;
59 60
    DPXContext *const s = avctx->priv_data;
60 61
    AVFrame *picture  = data;
......
172 173
        case 8:
173 174
        case 12: // Treat 12-bit as 16-bit
174 175
        case 16:
176
            if (source_packet_size*avctx->width*avctx->height > buf_end - buf) {
177
                av_log(avctx, AV_LOG_ERROR, "Overread buffer. Invalid header?\n");
178
                return -1;
179
            }
175 180
            if (source_packet_size == target_packet_size) {
176 181
                for (x = 0; x < avctx->height; x++) {
177 182
                    memcpy(ptr, buf, target_packet_size*avctx->width);

Also available in: Unified diff