aomenc: initalize the image object Otherwise it would cause problem when calling aom_img_free() at the end if no frame is read. BUG=aomedia:2911 Change-Id: I4350d5294706d2d84341e601e9ed6063229d0451
diff --git a/apps/aomenc.c b/apps/aomenc.c index 789cd60..f69ffd0 100644 --- a/apps/aomenc.c +++ b/apps/aomenc.c
@@ -1715,6 +1715,7 @@ int profile_updated = 0; memset(&input, 0, sizeof(input)); + memset(&raw, 0, sizeof(raw)); exec_name = argv_[0]; /* Setup default input stream settings */ @@ -1989,14 +1990,10 @@ } if (pass == (global.pass ? global.pass - 1 : 0)) { - if (input.file_type == FILE_TYPE_Y4M) - /*The Y4M reader does its own allocation. - Just initialize this here to avoid problems if we never read any - frames.*/ - memset(&raw, 0, sizeof(raw)); - else + // The Y4M reader does its own allocation. + if (input.file_type != FILE_TYPE_Y4M) { aom_img_alloc(&raw, input.fmt, input.width, input.height, 32); - + } FOREACH_STREAM(stream, streams) { stream->rate_hist = init_rate_histogram(&stream->config.cfg, &global.framerate);