Revision bb82ea79 libavfilter/vf_showinfo.c

View differences:

libavfilter/vf_showinfo.c
43 43
    AVFilterContext *ctx = inlink->dst;
44 44
    ShowInfoContext *showinfo = ctx->priv;
45 45
    AVFilterBufferRef *picref = inlink->cur_buf;
46
    uint32_t plane_crc[4], crc = 0;
47
    int plane;
46
    uint32_t plane_crc[4] = {0}, crc = 0;
47
    int i, plane, vsub = av_pix_fmt_descriptors[inlink->format].log2_chroma_h;
48 48

  
49
    for (plane = 0; plane < 4; plane++) {
49
    for (plane = 0; picref->data[plane] && plane < 4; plane++) {
50 50
        size_t linesize = av_image_get_linesize(picref->format, picref->video->w, plane);
51
        plane_crc[plane] = av_adler32_update(0  , picref->data[plane], linesize);
52
        crc              = av_adler32_update(crc, picref->data[plane], linesize);
51
        uint8_t *data = picref->data[plane];
52
        int h = plane == 1 || plane == 2 ? inlink->h >> vsub : inlink->h;
53

  
54
        for (i = 0; i < h; i++) {
55
            plane_crc[plane] = av_adler32_update(plane_crc[plane], data, linesize);
56
            crc = av_adler32_update(crc, data, linesize);
57
            data += picref->linesize[plane];
58
        }
53 59
    }
54 60

  
55 61
    av_log(ctx, AV_LOG_INFO,

Also available in: Unified diff