summaryrefslogtreecommitdiff
path: root/libavcodec/cinepakenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-05-08 15:53:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-05-08 16:40:58 +0200
commit364e8904ce915a3fbb1bb86c29e81e9475b37fb9 (patch)
tree88a73d960038ab6980c2329026d64ae588060181 /libavcodec/cinepakenc.c
parent6c23a85000fd5956a2820495b2a081f65d03b962 (diff)
avcodec/cinepakenc: Fix "may be used uninitialized in this function" warnings
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/cinepakenc.c')
-rw-r--r--libavcodec/cinepakenc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/cinepakenc.c b/libavcodec/cinepakenc.c
index 7c6972a752..9c69ec5361 100644
--- a/libavcodec/cinepakenc.c
+++ b/libavcodec/cinepakenc.c
@@ -1120,14 +1120,14 @@ static int write_cvid_header(CinepakEncContext *s, unsigned char *buf, int num_s
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;
+ int num_strips, strip, i, y, nexty, size, temp_size;
AVPicture last_pict, pict, scratch_pict;
int64_t best_score = 0, score, score_temp;
#ifdef CINEPAK_REPORT_SERR
int64_t best_serr = 0, serr, serr_temp;
#endif
- int best_nstrips;
+ int best_nstrips = -1, best_size = -1; // mark as uninitialzed
if(s->pix_fmt == AV_PIX_FMT_RGB24) {
int x;
@@ -1239,6 +1239,8 @@ static int rd_frame(CinepakEncContext *s, const AVFrame *frame, int isakeyframe,
break;
}
+ av_assert0(best_nstrips >= 0 && best_size >= 0);
+
// let the number of strips slowly adapt to the changes in the contents,
// compared to full bruteforcing every time this will occasionally lead
// to some r/d performance loss but makes encoding up to several times faster