From: John Koleszar Date: Mon, 11 Mar 2013 19:30:29 +0000 (-0700) Subject: vpxdec: fix use of uninitialized do_scale argument X-Git-Tag: v1.3.0~1167 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=83f2a112acc7ea58e29344c479fc740ac5259358;p=libvpx vpxdec: fix use of uninitialized do_scale argument This fixes a potential crash with VP8 streams that have an alt-ref on the first frame, as well as potentially scaling the output in cases where that wasn't desired. Change-Id: I1fd74b5ab43329fbbffecb004dfd44de34c4dc22 --- diff --git a/vpxdec.c b/vpxdec.c index 30196ecc8..41c654fae 100644 --- a/vpxdec.c +++ b/vpxdec.c @@ -711,7 +711,7 @@ int main(int argc, const char **argv_) { struct input_ctx input = {0}; int frames_corrupted = 0; int dec_flags = 0; - int do_scale; + int do_scale = 0; int stream_w = 0, stream_h = 0; vpx_image_t *scaled_img = NULL; @@ -1024,7 +1024,7 @@ int main(int argc, const char **argv_) { if (!noblit) { if (do_scale) { - if (frame_out == 1) { + if (img && frame_out == 1) { stream_w = img->d_w; stream_h = img->d_h; scaled_img = vpx_img_alloc(NULL, VPX_IMG_FMT_I420,