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

libavcodec/mjpegdec.c:877:21: 
875.                 y = 0;
876.                 for (j = 0; j < n; j++) {
877.                     block_offset = (((linesize[c] * (v * mb_y + y) * 8) +
                         ^
878.                                      (h * mb_x + x) * 8) >> s->avctx->lowres);
879. 

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;
            if (get_bits_count(&s->gb)>s->gb.size_in_bits) {
                av_log(s->avctx, AV_LOG_ERROR, "overread %d\n",
                       get_bits_count(&s->gb) - s->gb.size_in_bits);
                return -1;
            }
            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--;
                i = 8 + ((-get_bits_count(&s->gb)) & 7);
                if (show_bits(&s->gb, i) == (1 << i) - 1) {
                    int pos = get_bits_count(&s->gb);
                    align_get_bits(&s->gb);
                    while (get_bits_left(&s->gb) >= 8 && show_bits(&s->gb, 8) == 0xFF)
                        skip_bits(&s->gb, 8);
                    if ((get_bits(&s->gb, 8) & 0xF8) == 0xD0) {
                        for (i = 0; i < nb_components; i++)
                            s->last_dc[i] = 1024;
                    } else
                        skip_bits_long(&s->gb, pos - get_bits_count(&s->gb));
                }
            }
        }
    }
    return 0;
}
['static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,\n                             int Al, const uint8_t *mb_bitmask,\n                             const AVFrame *reference)\n{\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    if (s->flipped && s->avctx->flags & CODEC_FLAG_EMU_EDGE) {\n        av_log(s->avctx, AV_LOG_ERROR,\n               "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] *\n                         (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            if (get_bits_count(&s->gb)>s->gb.size_in_bits) {\n                av_log(s->avctx, AV_LOG_ERROR, "overread %d\\n",\n                       get_bits_count(&s->gb) - s->gb.size_in_bits);\n                return -1;\n            }\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,\n                                             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,\n                                       "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) +\n                                         (h * mb_x + x);\n                        DCTELEM *block = s->blocks[c][block_idx];\n                        if (Ah)\n                            block[0] += get_bits1(&s->gb) *\n                                        s->quant_matrixes[s->quant_index[c]][0] << Al;\n                        else if (decode_dc_progressive(s, block, i, s->dc_index[i],\n                                                       s->quant_matrixes[s->quant_index[c]],\n                                                       Al) < 0) {\n                            av_log(s->avctx, AV_LOG_ERROR,\n                                   "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) {\n                s->restart_count--;\n                i = 8 + ((-get_bits_count(&s->gb)) & 7);\n                if (show_bits(&s->gb, i) == (1 << i) - 1) {\n                    int pos = get_bits_count(&s->gb);\n                    align_get_bits(&s->gb);\n                    while (get_bits_left(&s->gb) >= 8 && show_bits(&s->gb, 8) == 0xFF)\n                        skip_bits(&s->gb, 8);\n                    if ((get_bits(&s->gb, 8) & 0xF8) == 0xD0) {\n                        for (i = 0; i < nb_components; i++)\n                            s->last_dc[i] = 1024;\n                    } else\n                        skip_bits_long(&s->gb, pos - get_bits_count(&s->gb));\n                }\n            }\n        }\n    }\n    return 0;\n}']