libavcodec/cinepakenc.c:1134: error: Uninitialized Value
  The value read from best_nstrips was never initialized.

libavcodec/cinepakenc.c:1134:13: 
1132.                 s->max_strips = s->max_max_strips;
1133.         } else { // try to step down
1134.             s->max_strips = best_nstrips;
                  ^
1135.         }
1136.         s->min_strips = s->max_strips - 1;

static int rd_frame(CinepakEncContext *s, const AVFrame *frame,
                    int isakeyframe, unsigned char *buf, int buf_size)
{
    int num_strips, strip, i, y, nexty, size, temp_size, best_size;
    uint8_t *last_data    [4], *data    [4], *scratch_data    [4];
    int      last_linesize[4],  linesize[4],  scratch_linesize[4];
    int64_t best_score = 0, score, score_temp;
    int best_nstrips;
    if (s->pix_fmt == AV_PIX_FMT_RGB24) {
        int x;
        for (y = 0; y < s->h; y += 2)
            for (x = 0; x < s->w; x += 2) {
                uint8_t *ir[2];
                int32_t r, g, b, rr, gg, bb;
                ir[0] = frame->data[0] + x * 3 + y * frame->linesize[0];
                ir[1] = ir[0] + frame->linesize[0];
                get_sub_picture(s, x, y,
                                s->input_frame->data, s->input_frame->linesize,
                                scratch_data, scratch_linesize);
                r = g = b = 0;
                for (i = 0; i < 4; ++i) {
                    int i1, i2;
                    i1 = (i & 1);
                    i2 = (i >= 2);
                    rr = ir[i2][i1 * 3 + 0];
                    gg = ir[i2][i1 * 3 + 1];
                    bb = ir[i2][i1 * 3 + 2];
                    r += rr;
                    g += gg;
                    b += bb;
                    rr = (2396625 * rr + 4793251 * gg + 1198732 * bb) >> 23;
                    if (rr < 0)
                        rr = 0;
                    else if (rr > 255)
                        rr = 255;
                    scratch_data[0][i1 + i2 * scratch_linesize[0]] = rr;
                }
                rr = (-299683 * r - 599156 * g + 898839 * b) >> 23;
                if (rr < -128)
                    rr = -128;
                else if (rr > 127)
                    rr = 127;
                scratch_data[1][0] = rr + 128;
                rr = (748893 * r - 599156 * g - 149737 * b) >> 23;
                if (rr < -128)
                    rr = -128;
                else if (rr > 127)
                    rr = 127;
                scratch_data[2][0] = rr + 128;
            }
    }
    for (num_strips = s->min_strips; num_strips <= s->max_strips && num_strips <= s->h / MB_SIZE; num_strips++) {
        score = 0;
        size  = 0;
        for (y = 0, strip = 1; y < s->h; strip++, y = nexty) {
            int strip_height;
            nexty = strip * s->h / num_strips;
            if (nexty & 3)
                nexty += 4 - (nexty & 3);
            strip_height = nexty - y;
            if (strip_height <= 0) {
                av_log(s->avctx, AV_LOG_INFO, "skipping zero height strip %i of %i\n", strip, num_strips);
                continue;
            }
            if (s->pix_fmt == AV_PIX_FMT_RGB24)
                get_sub_picture(s, 0, y,
                                s->input_frame->data, s->input_frame->linesize,
                                data, linesize);
            else
                get_sub_picture(s, 0, y,
                                (uint8_t **)frame->data, (int *)frame->linesize,
                                data, linesize);
            get_sub_picture(s, 0, y,
                            s->last_frame->data, s->last_frame->linesize,
                            last_data, last_linesize);
            get_sub_picture(s, 0, y,
                            s->scratch_frame->data, s->scratch_frame->linesize,
                            scratch_data, scratch_linesize);
            if ((temp_size = rd_strip(s, y, strip_height, isakeyframe,
                                      last_data, last_linesize, data, linesize,
                                      scratch_data, scratch_linesize,
                                      s->frame_buf + size + CVID_HEADER_SIZE,
                                      &score_temp)) < 0)
                return temp_size;
            score += score_temp;
            size += temp_size;
        }
        if (best_score == 0 || score < best_score) {
            best_score = score;
            best_size = size + write_cvid_header(s, s->frame_buf, num_strips, size, isakeyframe);
            FFSWAP(AVFrame *, s->best_frame, s->scratch_frame);
            memcpy(buf, s->frame_buf, best_size);
            best_nstrips = num_strips;
        }
        if (num_strips - best_nstrips > 4)
            break;
    }
    if (!s->strip_number_delta_range) {
        if (best_nstrips == s->max_strips) {
            s->max_strips = best_nstrips + 1;
            if (s->max_strips >= s->max_max_strips)
                s->max_strips = s->max_max_strips;
        } else {
            s->max_strips = best_nstrips;
        }
        s->min_strips = s->max_strips - 1;
        if (s->min_strips < s->min_min_strips)
            s->min_strips = s->min_min_strips;
    } else {
        s->max_strips = best_nstrips + s->strip_number_delta_range;
        if (s->max_strips >= s->max_max_strips)
            s->max_strips = s->max_max_strips;
        s->min_strips = best_nstrips - s->strip_number_delta_range;
        if (s->min_strips < s->min_min_strips)
            s->min_strips = s->min_min_strips;
    }
    return best_size;
}
['static int rd_frame(CinepakEncContext *s, const AVFrame *frame,\n                    int isakeyframe, unsigned char *buf, int buf_size)\n{\n    int num_strips, strip, i, y, nexty, size, temp_size, best_size;\n    uint8_t *last_data    [4], *data    [4], *scratch_data    [4];\n    int      last_linesize[4],  linesize[4],  scratch_linesize[4];\n    int64_t best_score = 0, score, score_temp;\n    int best_nstrips;\n    if (s->pix_fmt == AV_PIX_FMT_RGB24) {\n        int x;\n        for (y = 0; y < s->h; y += 2)\n            for (x = 0; x < s->w; x += 2) {\n                uint8_t *ir[2];\n                int32_t r, g, b, rr, gg, bb;\n                ir[0] = frame->data[0] + x * 3 + y * frame->linesize[0];\n                ir[1] = ir[0] + frame->linesize[0];\n                get_sub_picture(s, x, y,\n                                s->input_frame->data, s->input_frame->linesize,\n                                scratch_data, scratch_linesize);\n                r = g = b = 0;\n                for (i = 0; i < 4; ++i) {\n                    int i1, i2;\n                    i1 = (i & 1);\n                    i2 = (i >= 2);\n                    rr = ir[i2][i1 * 3 + 0];\n                    gg = ir[i2][i1 * 3 + 1];\n                    bb = ir[i2][i1 * 3 + 2];\n                    r += rr;\n                    g += gg;\n                    b += bb;\n                    rr = (2396625 * rr + 4793251 * gg + 1198732 * bb) >> 23;\n                    if (rr < 0)\n                        rr = 0;\n                    else if (rr > 255)\n                        rr = 255;\n                    scratch_data[0][i1 + i2 * scratch_linesize[0]] = rr;\n                }\n                rr = (-299683 * r - 599156 * g + 898839 * b) >> 23;\n                if (rr < -128)\n                    rr = -128;\n                else if (rr > 127)\n                    rr = 127;\n                scratch_data[1][0] = rr + 128;\n                rr = (748893 * r - 599156 * g - 149737 * b) >> 23;\n                if (rr < -128)\n                    rr = -128;\n                else if (rr > 127)\n                    rr = 127;\n                scratch_data[2][0] = rr + 128;\n            }\n    }\n    for (num_strips = s->min_strips; num_strips <= s->max_strips && num_strips <= s->h / MB_SIZE; num_strips++) {\n        score = 0;\n        size  = 0;\n        for (y = 0, strip = 1; y < s->h; strip++, y = nexty) {\n            int strip_height;\n            nexty = strip * s->h / num_strips;\n            if (nexty & 3)\n                nexty += 4 - (nexty & 3);\n            strip_height = nexty - y;\n            if (strip_height <= 0) {\n                av_log(s->avctx, AV_LOG_INFO, "skipping zero height strip %i of %i\\n", strip, num_strips);\n                continue;\n            }\n            if (s->pix_fmt == AV_PIX_FMT_RGB24)\n                get_sub_picture(s, 0, y,\n                                s->input_frame->data, s->input_frame->linesize,\n                                data, linesize);\n            else\n                get_sub_picture(s, 0, y,\n                                (uint8_t **)frame->data, (int *)frame->linesize,\n                                data, linesize);\n            get_sub_picture(s, 0, y,\n                            s->last_frame->data, s->last_frame->linesize,\n                            last_data, last_linesize);\n            get_sub_picture(s, 0, y,\n                            s->scratch_frame->data, s->scratch_frame->linesize,\n                            scratch_data, scratch_linesize);\n            if ((temp_size = rd_strip(s, y, strip_height, isakeyframe,\n                                      last_data, last_linesize, data, linesize,\n                                      scratch_data, scratch_linesize,\n                                      s->frame_buf + size + CVID_HEADER_SIZE,\n                                      &score_temp)) < 0)\n                return temp_size;\n            score += score_temp;\n            size += temp_size;\n        }\n        if (best_score == 0 || score < best_score) {\n            best_score = score;\n            best_size = size + write_cvid_header(s, s->frame_buf, num_strips, size, isakeyframe);\n            FFSWAP(AVFrame *, s->best_frame, s->scratch_frame);\n            memcpy(buf, s->frame_buf, best_size);\n            best_nstrips = num_strips;\n        }\n        if (num_strips - best_nstrips > 4)\n            break;\n    }\n    if (!s->strip_number_delta_range) {\n        if (best_nstrips == s->max_strips) {\n            s->max_strips = best_nstrips + 1;\n            if (s->max_strips >= s->max_max_strips)\n                s->max_strips = s->max_max_strips;\n        } else {\n            s->max_strips = best_nstrips;\n        }\n        s->min_strips = s->max_strips - 1;\n        if (s->min_strips < s->min_min_strips)\n            s->min_strips = s->min_min_strips;\n    } else {\n        s->max_strips = best_nstrips + s->strip_number_delta_range;\n        if (s->max_strips >= s->max_max_strips)\n            s->max_strips = s->max_max_strips;\n        s->min_strips = best_nstrips - s->strip_number_delta_range;\n        if (s->min_strips < s->min_min_strips)\n            s->min_strips = s->min_min_strips;\n    }\n    return best_size;\n}']