Revision dc172ecc libavcodec/utils.c

View differences:

libavcodec/utils.c
286 286
        int unaligned;
287 287
        AVPicture picture;
288 288
        int stride_align[4];
289
        const int pixel_size = av_pix_fmt_descriptors[s->pix_fmt].comp[0].step_minus1+1;
289 290

  
290 291
        avcodec_get_chroma_sub_sample(s->pix_fmt, &h_chroma_shift, &v_chroma_shift);
291 292

  
......
335 336
            if((s->flags&CODEC_FLAG_EMU_EDGE) || !size[2])
336 337
                buf->data[i] = buf->base[i];
337 338
            else
338
                buf->data[i] = buf->base[i] + FFALIGN((buf->linesize[i]*EDGE_WIDTH>>v_shift) + (EDGE_WIDTH>>h_shift), stride_align[i]);
339
                buf->data[i] = buf->base[i] + FFALIGN((buf->linesize[i]*EDGE_WIDTH>>v_shift) + (pixel_size*EDGE_WIDTH>>h_shift), stride_align[i]);
339 340
        }
340 341
        if(size[1] && !size[2])
341 342
            ff_set_systematic_pal2((uint32_t*)buf->data[1], s->pix_fmt);

Also available in: Unified diff