From 88d703cd4d7f091b9e5c053cd74170ca6bfcc8ad Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Fri, 9 Nov 2012 09:07:50 -0800 Subject: [PATCH] Fix another crash in vpxenc with --pass=1 and --test-decode. Change-Id: Id23917ce2555519d2e9172dd6ce3a283f2235d26 --- vpxenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vpxenc.c b/vpxenc.c index 33dd805ad..72fdf855b 100644 --- a/vpxenc.c +++ b/vpxenc.c @@ -2132,12 +2132,11 @@ static void get_cx_data(struct stream_state *stream, const struct vpx_codec_enc_cfg *cfg = &stream->config.cfg; vpx_codec_iter_t iter = NULL; + *got_data = 0; while ((pkt = vpx_codec_get_cx_data(&stream->encoder, &iter))) { static size_t fsize = 0; static off_t ivf_header_pos = 0; - *got_data = 1; - switch (pkt->kind) { case VPX_CODEC_CX_FRAME_PKT: if (!(pkt->data.frame.flags & VPX_FRAME_IS_FRAGMENT)) { @@ -2178,6 +2177,7 @@ static void get_cx_data(struct stream_state *stream, } stream->nbytes += pkt->data.raw.sz; + *got_data = 1; if (global->test_decode) { vpx_codec_decode(&stream->decoder, pkt->data.frame.buf, pkt->data.frame.sz, NULL, 0);