Revision 6a02cb82 libavcodec/fraps.c

View differences:

libavcodec/fraps.c
84 84
 * decode Fraps v2 packed plane
85 85
 */
86 86
static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w,
87
                               int h, const uint8_t *src, int size, int Uoff)
87
                               int h, const uint8_t *src, int size, int Uoff,
88
                               const int step)
88 89
{
89 90
    int i, j;
90 91
    GetBitContext gb;
......
104 105

  
105 106
    init_get_bits(&gb, s->tmpbuf, size * 8);
106 107
    for(j = 0; j < h; j++){
107
        for(i = 0; i < w; i++){
108
        for(i = 0; i < w*step; i += step){
108 109
            dst[i] = get_vlc2(&gb, vlc.table, 9, 3);
109 110
            /* lines are stored as deltas between previous lines
110 111
             * and we need to add 0x80 to the first lines of chroma planes
......
281 282
            is_chroma = !!i;
282 283
            s->tmpbuf = av_realloc(s->tmpbuf, offs[i + 1] - offs[i] - 1024 + FF_INPUT_BUFFER_PADDING_SIZE);
283 284
            if(fraps2_decode_plane(s, f->data[i], f->linesize[i], avctx->width >> is_chroma,
284
                    avctx->height >> is_chroma, buf + offs[i], offs[i + 1] - offs[i], is_chroma) < 0) {
285
                    avctx->height >> is_chroma, buf + offs[i], offs[i + 1] - offs[i], is_chroma, 1) < 0) {
285 286
                av_log(avctx, AV_LOG_ERROR, "Error decoding plane %i\n", i);
286 287
                return -1;
287 288
            }

Also available in: Unified diff