call vp[89]_clear_system_state after longjmp
authorJames Zern <jzern@google.com>
Thu, 10 Jul 2014 19:36:28 +0000 (12:36 -0700)
committerJames Zern <jzern@google.com>
Thu, 10 Jul 2014 19:36:28 +0000 (12:36 -0700)
restore the environment post encode/decode failure

Change-Id: I3c72e2260a616432eaf1f9545d4fb4d8e45cc7b0

vp8/decoder/onyxd_if.c
vp8/encoder/onyx_if.c
vp8/vp8_dx_iface.c
vp9/decoder/vp9_decoder.c

index 29fea61..1d763b6 100644 (file)
@@ -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)
index 09854a5..373dbeb 100644 (file)
@@ -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;
     }
 
index 56394fb..b695ddc 100644 (file)
@@ -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;
                 }
index a1a78a9..e32637b 100644 (file)
@@ -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