diff options
author | James Zern <jzern@google.com> | 2016-02-11 18:05:31 -0800 |
---|---|---|
committer | James Zern <jzern@google.com> | 2016-02-11 19:20:12 -0800 |
commit | 6c323e359a413018d48c29720aef5654721e14c0 (patch) | |
tree | d15aebd4c0f25d75ac4e945514917afef76299ed /vp9 | |
parent | 34d12d116051e4e9c877b601f9add06ad725f6e3 (diff) | |
download | libvpx-6c323e359a413018d48c29720aef5654721e14c0.tar libvpx-6c323e359a413018d48c29720aef5654721e14c0.tar.gz libvpx-6c323e359a413018d48c29720aef5654721e14c0.tar.bz2 libvpx-6c323e359a413018d48c29720aef5654721e14c0.zip |
vp9_receive_raw_frame: add missing setjmp
allocations done within this function are protected with
vpx_internal_error; adding the setjmp fixes a crash in
vp9_lookahead_push() under low memory conditions.
Change-Id: I4b79dca37cc7fadc4b7633f0db44c0e406799bc6
Diffstat (limited to 'vp9')
-rw-r--r-- | vp9/encoder/vp9_encoder.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index ff176fb93..19cc2360a 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -4153,13 +4153,22 @@ static void check_initial_width(VP9_COMP *cpi, int vp9_receive_raw_frame(VP9_COMP *cpi, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, int64_t time_stamp, int64_t end_time) { - VP9_COMMON *cm = &cpi->common; + VP9_COMMON *volatile const cm = &cpi->common; struct vpx_usec_timer timer; - int res = 0; + volatile int res = 0; const int subsampling_x = sd->subsampling_x; const int subsampling_y = sd->subsampling_y; #if CONFIG_VP9_HIGHBITDEPTH const int use_highbitdepth = (sd->flags & YV12_FLAG_HIGHBITDEPTH) != 0; +#endif + + if (setjmp(cm->error.jmp)) { + cm->error.setjmp = 0; + return -1; + } + cm->error.setjmp = 1; + +#if CONFIG_VP9_HIGHBITDEPTH check_initial_width(cpi, use_highbitdepth, subsampling_x, subsampling_y); #else check_initial_width(cpi, subsampling_x, subsampling_y); @@ -4192,6 +4201,7 @@ int vp9_receive_raw_frame(VP9_COMP *cpi, unsigned int frame_flags, res = -1; } + cm->error.setjmp = 0; return res; } |