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

libavcodec/mjpegdec.c:539:17: 
537.                 int pred;
538. 
539.                 topleft[i]= top[i];
                     ^
540.                 top[i]= buffer[mb_x][i];
541. 

static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int predictor, int point_transform){
    int i, mb_x, mb_y;
    uint16_t buffer[32768][4];
    int left[3], top[3], topleft[3];
    const int linesize= s->linesize[0];
    const int mask= (1<<s->bits)-1;
    if((unsigned)s->mb_width > 32768)
        return -1;
    for(i=0; i<3; i++){
        buffer[0][i]= 1 << (s->bits + point_transform - 1);
    }
    for(mb_y = 0; mb_y < s->mb_height; mb_y++) {
        const int modified_predictor= mb_y ? predictor : 1;
        uint8_t *ptr = s->picture.data[0] + (linesize * mb_y);
        if (s->interlaced && s->bottom_field)
            ptr += linesize >> 1;
        for(i=0; i<3; i++){
            top[i]= left[i]= topleft[i]= buffer[0][i];
        }
        for(mb_x = 0; mb_x < s->mb_width; mb_x++) {
            if (s->restart_interval && !s->restart_count)
                s->restart_count = s->restart_interval;
            for(i=0;i<3;i++) {
                int pred;
                topleft[i]= top[i];
                top[i]= buffer[mb_x][i];
                PREDICT(pred, topleft[i], top[i], left[i], modified_predictor);
                left[i]=
                buffer[mb_x][i]= mask & (pred + (mjpeg_decode_dc(s, s->dc_index[i]) << point_transform));
            }
            if (s->restart_interval && !--s->restart_count) {
                align_get_bits(&s->gb);
                skip_bits(&s->gb, 16);
            }
        }
        if(s->rct){
            for(mb_x = 0; mb_x < s->mb_width; mb_x++) {
                ptr[4*mb_x+1] = buffer[mb_x][0] - ((buffer[mb_x][1] + buffer[mb_x][2] - 0x200)>>2);
                ptr[4*mb_x+0] = buffer[mb_x][1] + ptr[4*mb_x+1];
                ptr[4*mb_x+2] = buffer[mb_x][2] + ptr[4*mb_x+1];
            }
        }else if(s->pegasus_rct){
            for(mb_x = 0; mb_x < s->mb_width; mb_x++) {
                ptr[4*mb_x+1] = buffer[mb_x][0] - ((buffer[mb_x][1] + buffer[mb_x][2])>>2);
                ptr[4*mb_x+0] = buffer[mb_x][1] + ptr[4*mb_x+1];
                ptr[4*mb_x+2] = buffer[mb_x][2] + ptr[4*mb_x+1];
            }
        }else{
            for(mb_x = 0; mb_x < s->mb_width; mb_x++) {
                ptr[4*mb_x+0] = buffer[mb_x][0];
                ptr[4*mb_x+1] = buffer[mb_x][1];
                ptr[4*mb_x+2] = buffer[mb_x][2];
            }
        }
    }
    return 0;
}
['static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int predictor, int point_transform){\n    int i, mb_x, mb_y;\n    uint16_t buffer[32768][4];\n    int left[3], top[3], topleft[3];\n    const int linesize= s->linesize[0];\n    const int mask= (1<<s->bits)-1;\n    if((unsigned)s->mb_width > 32768)\n        return -1;\n    for(i=0; i<3; i++){\n        buffer[0][i]= 1 << (s->bits + point_transform - 1);\n    }\n    for(mb_y = 0; mb_y < s->mb_height; mb_y++) {\n        const int modified_predictor= mb_y ? predictor : 1;\n        uint8_t *ptr = s->picture.data[0] + (linesize * mb_y);\n        if (s->interlaced && s->bottom_field)\n            ptr += linesize >> 1;\n        for(i=0; i<3; i++){\n            top[i]= left[i]= topleft[i]= buffer[0][i];\n        }\n        for(mb_x = 0; mb_x < s->mb_width; mb_x++) {\n            if (s->restart_interval && !s->restart_count)\n                s->restart_count = s->restart_interval;\n            for(i=0;i<3;i++) {\n                int pred;\n                topleft[i]= top[i];\n                top[i]= buffer[mb_x][i];\n                PREDICT(pred, topleft[i], top[i], left[i], modified_predictor);\n                left[i]=\n                buffer[mb_x][i]= mask & (pred + (mjpeg_decode_dc(s, s->dc_index[i]) << point_transform));\n            }\n            if (s->restart_interval && !--s->restart_count) {\n                align_get_bits(&s->gb);\n                skip_bits(&s->gb, 16);\n            }\n        }\n        if(s->rct){\n            for(mb_x = 0; mb_x < s->mb_width; mb_x++) {\n                ptr[4*mb_x+1] = buffer[mb_x][0] - ((buffer[mb_x][1] + buffer[mb_x][2] - 0x200)>>2);\n                ptr[4*mb_x+0] = buffer[mb_x][1] + ptr[4*mb_x+1];\n                ptr[4*mb_x+2] = buffer[mb_x][2] + ptr[4*mb_x+1];\n            }\n        }else if(s->pegasus_rct){\n            for(mb_x = 0; mb_x < s->mb_width; mb_x++) {\n                ptr[4*mb_x+1] = buffer[mb_x][0] - ((buffer[mb_x][1] + buffer[mb_x][2])>>2);\n                ptr[4*mb_x+0] = buffer[mb_x][1] + ptr[4*mb_x+1];\n                ptr[4*mb_x+2] = buffer[mb_x][2] + ptr[4*mb_x+1];\n            }\n        }else{\n            for(mb_x = 0; mb_x < s->mb_width; mb_x++) {\n                ptr[4*mb_x+0] = buffer[mb_x][0];\n                ptr[4*mb_x+1] = buffer[mb_x][1];\n                ptr[4*mb_x+2] = buffer[mb_x][2];\n            }\n        }\n    }\n    return 0;\n}']