libavcodec/ffv1.c:1375: error: Uninitialized Value
  The value read from context_count was never initialized.

libavcodec/ffv1.c:1375:16: 
1373.             }
1374. 
1375.             if(p->context_count < context_count){
                     ^
1376.                 av_freep(&p->state);
1377.                 av_freep(&p->vlc_state);

static int read_header(FFV1Context *f){
    uint8_t state[CONTEXT_SIZE];
    int i, j, context_count;
    RangeCoder * const c= &f->slice_context[0]->c;
    memset(state, 128, sizeof(state));
    if(f->version < 2){
        f->version= get_symbol(c, state, 0);
        f->ac= f->avctx->coder_type= get_symbol(c, state, 0);
        if(f->ac>1){
            for(i=1; i<256; i++){
                f->state_transition[i]= get_symbol(c, state, 1) + c->one_state[i];
            }
        }
        f->colorspace= get_symbol(c, state, 0);
        if(f->version>0)
            f->avctx->bits_per_raw_sample= get_symbol(c, state, 0);
        get_rac(c, state);
        f->chroma_h_shift= get_symbol(c, state, 0);
        f->chroma_v_shift= get_symbol(c, state, 0);
        get_rac(c, state);
        f->plane_count= 2;
    }
    if(f->colorspace==0){
        if(f->avctx->bits_per_raw_sample<=8){
            switch(16*f->chroma_h_shift + f->chroma_v_shift){
            case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P; break;
            case 0x10: f->avctx->pix_fmt= PIX_FMT_YUV422P; break;
            case 0x11: f->avctx->pix_fmt= PIX_FMT_YUV420P; break;
            case 0x20: f->avctx->pix_fmt= PIX_FMT_YUV411P; break;
            case 0x22: f->avctx->pix_fmt= PIX_FMT_YUV410P; break;
            default:
                av_log(f->avctx, AV_LOG_ERROR, "format not supported\n");
                return -1;
            }
        }else{
            switch(16*f->chroma_h_shift + f->chroma_v_shift){
            case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P16; break;
            case 0x10: f->avctx->pix_fmt= PIX_FMT_YUV422P16; break;
            case 0x11: f->avctx->pix_fmt= PIX_FMT_YUV420P16; break;
            default:
                av_log(f->avctx, AV_LOG_ERROR, "format not supported\n");
                return -1;
            }
        }
    }else if(f->colorspace==1){
        if(f->chroma_h_shift || f->chroma_v_shift){
            av_log(f->avctx, AV_LOG_ERROR, "chroma subsampling not supported in this colorspace\n");
            return -1;
        }
        f->avctx->pix_fmt= PIX_FMT_RGB32;
    }else{
        av_log(f->avctx, AV_LOG_ERROR, "colorspace not supported\n");
        return -1;
    }
    if(f->version < 2){
        context_count= read_quant_tables(c, f->quant_table);
        if(context_count < 0){
                av_log(f->avctx, AV_LOG_ERROR, "read_quant_table error\n");
                return -1;
        }
    }else{
        f->slice_count= get_symbol(c, state, 0);
        if(f->slice_count > (unsigned)MAX_SLICES)
            return -1;
    }
    for(j=0; j<f->slice_count; j++){
        FFV1Context *fs= f->slice_context[j];
        fs->ac= f->ac;
        if(f->version >= 2){
            fs->slice_x     = get_symbol(c, state, 0)   *f->width ;
            fs->slice_y     = get_symbol(c, state, 0)   *f->height;
            fs->slice_width =(get_symbol(c, state, 0)+1)*f->width  + fs->slice_x;
            fs->slice_height=(get_symbol(c, state, 0)+1)*f->height + fs->slice_y;
            fs->slice_x /= f->num_h_slices;
            fs->slice_y /= f->num_v_slices;
            fs->slice_width  = fs->slice_width /f->num_h_slices - fs->slice_x;
            fs->slice_height = fs->slice_height/f->num_v_slices - fs->slice_y;
            if((unsigned)fs->slice_width > f->width || (unsigned)fs->slice_height > f->height)
                return -1;
            if(    (unsigned)fs->slice_x + (uint64_t)fs->slice_width  > f->width
                || (unsigned)fs->slice_y + (uint64_t)fs->slice_height > f->height)
                return -1;
        }
        for(i=0; i<f->plane_count; i++){
            PlaneContext * const p= &fs->plane[i];
            if(f->version >= 2){
                int idx=get_symbol(c, state, 0);
                if(idx > (unsigned)f->quant_table_count){
                    av_log(f->avctx, AV_LOG_ERROR, "quant_table_index out of range\n");
                    return -1;
                }
                memcpy(p->quant_table, f->quant_tables[idx], sizeof(p->quant_table));
                context_count= f->context_count[idx];
            }else{
                memcpy(p->quant_table, f->quant_table, sizeof(p->quant_table));
            }
            if(p->context_count < context_count){
                av_freep(&p->state);
                av_freep(&p->vlc_state);
            }
            p->context_count= context_count;
        }
    }
    return 0;
}
['static int read_header(FFV1Context *f){\n    uint8_t state[CONTEXT_SIZE];\n    int i, j, context_count;\n    RangeCoder * const c= &f->slice_context[0]->c;\n    memset(state, 128, sizeof(state));\n    if(f->version < 2){\n        f->version= get_symbol(c, state, 0);\n        f->ac= f->avctx->coder_type= get_symbol(c, state, 0);\n        if(f->ac>1){\n            for(i=1; i<256; i++){\n                f->state_transition[i]= get_symbol(c, state, 1) + c->one_state[i];\n            }\n        }\n        f->colorspace= get_symbol(c, state, 0);\n        if(f->version>0)\n            f->avctx->bits_per_raw_sample= get_symbol(c, state, 0);\n        get_rac(c, state);\n        f->chroma_h_shift= get_symbol(c, state, 0);\n        f->chroma_v_shift= get_symbol(c, state, 0);\n        get_rac(c, state);\n        f->plane_count= 2;\n    }\n    if(f->colorspace==0){\n        if(f->avctx->bits_per_raw_sample<=8){\n            switch(16*f->chroma_h_shift + f->chroma_v_shift){\n            case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P; break;\n            case 0x10: f->avctx->pix_fmt= PIX_FMT_YUV422P; break;\n            case 0x11: f->avctx->pix_fmt= PIX_FMT_YUV420P; break;\n            case 0x20: f->avctx->pix_fmt= PIX_FMT_YUV411P; break;\n            case 0x22: f->avctx->pix_fmt= PIX_FMT_YUV410P; break;\n            default:\n                av_log(f->avctx, AV_LOG_ERROR, "format not supported\\n");\n                return -1;\n            }\n        }else{\n            switch(16*f->chroma_h_shift + f->chroma_v_shift){\n            case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P16; break;\n            case 0x10: f->avctx->pix_fmt= PIX_FMT_YUV422P16; break;\n            case 0x11: f->avctx->pix_fmt= PIX_FMT_YUV420P16; break;\n            default:\n                av_log(f->avctx, AV_LOG_ERROR, "format not supported\\n");\n                return -1;\n            }\n        }\n    }else if(f->colorspace==1){\n        if(f->chroma_h_shift || f->chroma_v_shift){\n            av_log(f->avctx, AV_LOG_ERROR, "chroma subsampling not supported in this colorspace\\n");\n            return -1;\n        }\n        f->avctx->pix_fmt= PIX_FMT_RGB32;\n    }else{\n        av_log(f->avctx, AV_LOG_ERROR, "colorspace not supported\\n");\n        return -1;\n    }\n    if(f->version < 2){\n        context_count= read_quant_tables(c, f->quant_table);\n        if(context_count < 0){\n                av_log(f->avctx, AV_LOG_ERROR, "read_quant_table error\\n");\n                return -1;\n        }\n    }else{\n        f->slice_count= get_symbol(c, state, 0);\n        if(f->slice_count > (unsigned)MAX_SLICES)\n            return -1;\n    }\n    for(j=0; j<f->slice_count; j++){\n        FFV1Context *fs= f->slice_context[j];\n        fs->ac= f->ac;\n        if(f->version >= 2){\n            fs->slice_x     = get_symbol(c, state, 0)   *f->width ;\n            fs->slice_y     = get_symbol(c, state, 0)   *f->height;\n            fs->slice_width =(get_symbol(c, state, 0)+1)*f->width  + fs->slice_x;\n            fs->slice_height=(get_symbol(c, state, 0)+1)*f->height + fs->slice_y;\n            fs->slice_x /= f->num_h_slices;\n            fs->slice_y /= f->num_v_slices;\n            fs->slice_width  = fs->slice_width /f->num_h_slices - fs->slice_x;\n            fs->slice_height = fs->slice_height/f->num_v_slices - fs->slice_y;\n            if((unsigned)fs->slice_width > f->width || (unsigned)fs->slice_height > f->height)\n                return -1;\n            if(    (unsigned)fs->slice_x + (uint64_t)fs->slice_width  > f->width\n                || (unsigned)fs->slice_y + (uint64_t)fs->slice_height > f->height)\n                return -1;\n        }\n        for(i=0; i<f->plane_count; i++){\n            PlaneContext * const p= &fs->plane[i];\n            if(f->version >= 2){\n                int idx=get_symbol(c, state, 0);\n                if(idx > (unsigned)f->quant_table_count){\n                    av_log(f->avctx, AV_LOG_ERROR, "quant_table_index out of range\\n");\n                    return -1;\n                }\n                memcpy(p->quant_table, f->quant_tables[idx], sizeof(p->quant_table));\n                context_count= f->context_count[idx];\n            }else{\n                memcpy(p->quant_table, f->quant_table, sizeof(p->quant_table));\n            }\n            if(p->context_count < context_count){\n                av_freep(&p->state);\n                av_freep(&p->vlc_state);\n            }\n            p->context_count= context_count;\n        }\n    }\n    return 0;\n}']