Revision 09ab8859 libavcodec/imgconvert.c

View differences:

libavcodec/imgconvert.c
760 760

  
761 761
    for (i=0; i<data_planes; i++) {
762 762
        if (i == 1) {
763
            w = ((width >> desc->log2_chroma_w) * pf->depth + 7) / 8;
764
            h = height >> desc->log2_chroma_h;
763
            w = (- ((-width) >> desc->log2_chroma_w) * pf->depth + 7) / 8;
764
            h = -((-height) >> desc->log2_chroma_h);
765 765
            if (pix_fmt == PIX_FMT_NV12 || pix_fmt == PIX_FMT_NV21)
766 766
                w <<= 1;
767 767
        } else if (i == 3) {

Also available in: Unified diff