From 61c3338516af9daeb65eaa47e7fae8428facae5f Mon Sep 17 00:00:00 2001 From: James Zern Date: Thu, 10 Jul 2014 12:36:28 -0700 Subject: [PATCH] call vp[89]_clear_system_state after longjmp restore the environment post encode/decode failure Change-Id: I3c72e2260a616432eaf1f9545d4fb4d8e45cc7b0 --- vp8/decoder/onyxd_if.c | 1 + vp8/encoder/onyx_if.c | 1 + vp8/vp8_dx_iface.c | 1 + vp9/decoder/vp9_decoder.c | 1 + 4 files changed, 4 insertions(+) diff --git a/vp8/decoder/onyxd_if.c b/vp8/decoder/onyxd_if.c index 29fea616b..1d763b6bf 100644 --- a/vp8/decoder/onyxd_if.c +++ b/vp8/decoder/onyxd_if.c @@ -386,6 +386,7 @@ int vp8dx_receive_compressed_data(VP8D_COMP *pbi, size_t size, decode_exit: pbi->common.error.setjmp = 0; + vp8_clear_system_state(); return retcode; } int vp8dx_get_raw_frame(VP8D_COMP *pbi, YV12_BUFFER_CONFIG *sd, int64_t *time_stamp, int64_t *time_end_stamp, vp8_ppflags_t *flags) diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index 09854a544..373dbebd9 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -4886,6 +4886,7 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l if (setjmp(cpi->common.error.jmp)) { cpi->common.error.setjmp = 0; + vp8_clear_system_state(); return VPX_CODEC_CORRUPT_FRAME; } diff --git a/vp8/vp8_dx_iface.c b/vp8/vp8_dx_iface.c index 56394fb1c..b695ddc8d 100644 --- a/vp8/vp8_dx_iface.c +++ b/vp8/vp8_dx_iface.c @@ -409,6 +409,7 @@ static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t *ctx, if (setjmp(pbi->common.error.jmp)) { pbi->common.error.setjmp = 0; + vp8_clear_system_state(); /* same return value as used in vp8dx_receive_compressed_data */ return -1; } diff --git a/vp9/decoder/vp9_decoder.c b/vp9/decoder/vp9_decoder.c index a1a78a947..e32637b06 100644 --- a/vp9/decoder/vp9_decoder.c +++ b/vp9/decoder/vp9_decoder.c @@ -246,6 +246,7 @@ int vp9_receive_compressed_data(VP9Decoder *pbi, if (setjmp(cm->error.jmp)) { cm->error.setjmp = 0; + vp9_clear_system_state(); // We do not know if the missing frame(s) was supposed to update // any of the reference buffers, but we act conservative and