Revision e87eb039 libavfilter/vf_vflip.c

View differences:

libavfilter/vf_vflip.c
48 48
    AVFilterPicRef *picref = avfilter_get_video_buffer(link->dst->outputs[0],
49 49
                                                       perms, w, h);
50 50

  
51
    picref->data[0] += (h-1) * picref->linesize[0];
52
    picref->linesize[0] = -picref->linesize[0];
53
    for (i = 1; i < 4; i ++) {
51
    for (i = 0; i < 4; i ++) {
52
        int vsub = i == 1 || i == 2 ? flip->vsub : 0;
53

  
54 54
        if (picref->data[i]) {
55
            picref->data[i] += ((h >> flip->vsub)-1) * picref->linesize[i];
55
            picref->data[i] += ((h >> vsub)-1) * picref->linesize[i];
56 56
            picref->linesize[i] = -picref->linesize[i];
57 57
        }
58 58
    }
......
66 66
    AVFilterPicRef *ref2 = avfilter_ref_pic(picref, ~0);
67 67
    int i;
68 68

  
69
    ref2->data[0] += (link->h-1) * ref2->linesize[0];
70
    ref2->linesize[0] = -ref2->linesize[0];
71
    for (i = 1; i < 4; i ++) {
69
    for (i = 0; i < 4; i ++) {
70
        int vsub = i == 1 || i == 2 ? flip->vsub : 0;
71

  
72 72
        if (ref2->data[i]) {
73
            ref2->data[i] += ((link->h >> flip->vsub)-1) * ref2->linesize[i];
73
            ref2->data[i] += ((link->h >> vsub)-1) * ref2->linesize[i];
74 74
            ref2->linesize[i] = -ref2->linesize[i];
75 75
        }
76 76
    }

Also available in: Unified diff