libavcodec/mjpegdec.c:844: error: Uninitialized Value
  The value read from linesize[_] was never initialized.

libavcodec/mjpegdec.c:844:25: 
842. 
843.                     if(s->interlaced && s->bottom_field)
844.                         block_offset += linesize[c] >> 1;
                             ^
845.                     ptr = data[c] + block_offset;
846.                     if(!s->progressive) {

static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah, int Al,
                             const uint8_t *mb_bitmask, const AVFrame *reference){
    int i, mb_x, mb_y;
    uint8_t* data[MAX_COMPONENTS];
    const uint8_t *reference_data[MAX_COMPONENTS];
    int linesize[MAX_COMPONENTS];
    GetBitContext mb_bitmask_gb;
    if (mb_bitmask) {
        init_get_bits(&mb_bitmask_gb, mb_bitmask, s->mb_width*s->mb_height);
    }
    if(s->flipped && s->avctx->flags & CODEC_FLAG_EMU_EDGE) {
        av_log(s->avctx, AV_LOG_ERROR, "Can not flip image with CODEC_FLAG_EMU_EDGE set!\n");
        s->flipped = 0;
    }
    for(i=0; i < nb_components; i++) {
        int c = s->comp_index[i];
        data[c] = s->picture_ptr->data[c];
        reference_data[c] = reference ? reference->data[c] : NULL;
        linesize[c]=s->linesize[c];
        s->coefs_finished[c] |= 1;
        if(s->flipped) {
            int offset = (linesize[c] * (s->v_scount[i] * (8 * s->mb_height -((s->height/s->v_max)&7)) - 1 ));
            data[c] += offset;
            reference_data[c] += offset;
            linesize[c] *= -1;
        }
    }
    for(mb_y = 0; mb_y < s->mb_height; mb_y++) {
        for(mb_x = 0; mb_x < s->mb_width; mb_x++) {
            const int copy_mb = mb_bitmask && !get_bits1(&mb_bitmask_gb);
            if (s->restart_interval && !s->restart_count)
                s->restart_count = s->restart_interval;
            for(i=0;i<nb_components;i++) {
                uint8_t *ptr;
                int n, h, v, x, y, c, j;
                int block_offset;
                n = s->nb_blocks[i];
                c = s->comp_index[i];
                h = s->h_scount[i];
                v = s->v_scount[i];
                x = 0;
                y = 0;
                for(j=0;j<n;j++) {
                    block_offset = (((linesize[c] * (v * mb_y + y) * 8) +
                                     (h * mb_x + x) * 8) >> s->avctx->lowres);
                    if(s->interlaced && s->bottom_field)
                        block_offset += linesize[c] >> 1;
                    ptr = data[c] + block_offset;
                    if(!s->progressive) {
                        if (copy_mb) {
                            mjpeg_copy_block(ptr, reference_data[c] + block_offset, linesize[c], s->avctx->lowres);
                        } else {
                        s->dsp.clear_block(s->block);
                        if(decode_block(s, s->block, i,
                                     s->dc_index[i], s->ac_index[i],
                                     s->quant_matrixes[ s->quant_index[c] ]) < 0) {
                            av_log(s->avctx, AV_LOG_ERROR, "error y=%d x=%d\n", mb_y, mb_x);
                            return -1;
                        }
                        s->dsp.idct_put(ptr, linesize[c], s->block);
                        }
                    } else {
                        int block_idx = s->block_stride[c] * (v * mb_y + y) + (h * mb_x + x);
                        DCTELEM *block = s->blocks[c][block_idx];
                        if(Ah)
                            block[0] += get_bits1(&s->gb) * s->quant_matrixes[ s->quant_index[c] ][0] << Al;
                        else if(decode_dc_progressive(s, block, i, s->dc_index[i], s->quant_matrixes[ s->quant_index[c] ], Al) < 0) {
                            av_log(s->avctx, AV_LOG_ERROR, "error y=%d x=%d\n", mb_y, mb_x);
                            return -1;
                        }
                    }
                    if (++x == h) {
                        x = 0;
                        y++;
                    }
                }
            }
            if (s->restart_interval && !--s->restart_count) {
                align_get_bits(&s->gb);
                skip_bits(&s->gb, 16);
                for (i=0; i<nb_components; i++)
                    s->last_dc[i] = 1024;
            }
        }
    }
    return 0;
}
['static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah, int Al,\n                             const uint8_t *mb_bitmask, const AVFrame *reference){\n    int i, mb_x, mb_y;\n    uint8_t* data[MAX_COMPONENTS];\n    const uint8_t *reference_data[MAX_COMPONENTS];\n    int linesize[MAX_COMPONENTS];\n    GetBitContext mb_bitmask_gb;\n    if (mb_bitmask) {\n        init_get_bits(&mb_bitmask_gb, mb_bitmask, s->mb_width*s->mb_height);\n    }\n    if(s->flipped && s->avctx->flags & CODEC_FLAG_EMU_EDGE) {\n        av_log(s->avctx, AV_LOG_ERROR, "Can not flip image with CODEC_FLAG_EMU_EDGE set!\\n");\n        s->flipped = 0;\n    }\n    for(i=0; i < nb_components; i++) {\n        int c = s->comp_index[i];\n        data[c] = s->picture_ptr->data[c];\n        reference_data[c] = reference ? reference->data[c] : NULL;\n        linesize[c]=s->linesize[c];\n        s->coefs_finished[c] |= 1;\n        if(s->flipped) {\n            int offset = (linesize[c] * (s->v_scount[i] * (8 * s->mb_height -((s->height/s->v_max)&7)) - 1 ));\n            data[c] += offset;\n            reference_data[c] += offset;\n            linesize[c] *= -1;\n        }\n    }\n    for(mb_y = 0; mb_y < s->mb_height; mb_y++) {\n        for(mb_x = 0; mb_x < s->mb_width; mb_x++) {\n            const int copy_mb = mb_bitmask && !get_bits1(&mb_bitmask_gb);\n            if (s->restart_interval && !s->restart_count)\n                s->restart_count = s->restart_interval;\n            for(i=0;i<nb_components;i++) {\n                uint8_t *ptr;\n                int n, h, v, x, y, c, j;\n                int block_offset;\n                n = s->nb_blocks[i];\n                c = s->comp_index[i];\n                h = s->h_scount[i];\n                v = s->v_scount[i];\n                x = 0;\n                y = 0;\n                for(j=0;j<n;j++) {\n                    block_offset = (((linesize[c] * (v * mb_y + y) * 8) +\n                                     (h * mb_x + x) * 8) >> s->avctx->lowres);\n                    if(s->interlaced && s->bottom_field)\n                        block_offset += linesize[c] >> 1;\n                    ptr = data[c] + block_offset;\n                    if(!s->progressive) {\n                        if (copy_mb) {\n                            mjpeg_copy_block(ptr, reference_data[c] + block_offset, linesize[c], s->avctx->lowres);\n                        } else {\n                        s->dsp.clear_block(s->block);\n                        if(decode_block(s, s->block, i,\n                                     s->dc_index[i], s->ac_index[i],\n                                     s->quant_matrixes[ s->quant_index[c] ]) < 0) {\n                            av_log(s->avctx, AV_LOG_ERROR, "error y=%d x=%d\\n", mb_y, mb_x);\n                            return -1;\n                        }\n                        s->dsp.idct_put(ptr, linesize[c], s->block);\n                        }\n                    } else {\n                        int block_idx = s->block_stride[c] * (v * mb_y + y) + (h * mb_x + x);\n                        DCTELEM *block = s->blocks[c][block_idx];\n                        if(Ah)\n                            block[0] += get_bits1(&s->gb) * s->quant_matrixes[ s->quant_index[c] ][0] << Al;\n                        else if(decode_dc_progressive(s, block, i, s->dc_index[i], s->quant_matrixes[ s->quant_index[c] ], Al) < 0) {\n                            av_log(s->avctx, AV_LOG_ERROR, "error y=%d x=%d\\n", mb_y, mb_x);\n                            return -1;\n                        }\n                    }\n                    if (++x == h) {\n                        x = 0;\n                        y++;\n                    }\n                }\n            }\n            if (s->restart_interval && !--s->restart_count) {\n                align_get_bits(&s->gb);\n                skip_bits(&s->gb, 16);\n                for (i=0; i<nb_components; i++)\n                    s->last_dc[i] = 1024;\n            }\n        }\n    }\n    return 0;\n}']