summaryrefslogtreecommitdiff
path: root/vp9/decoder
diff options
context:
space:
mode:
authorJean-Yves Avenard <jyavenard@mozilla.com>2015-07-11 20:47:39 +1000
committerJohann <johannkoenig@google.com>2016-03-28 14:14:49 -0700
commit6f51672c4ec334e3978301ecb3c6847c2d33b19b (patch)
tree31b8e775d309924b5f4f315421c931f205211bba /vp9/decoder
parent48e7294e489ddbd84708c2856ef236d440dabd5e (diff)
downloadlibvpx-6f51672c4ec334e3978301ecb3c6847c2d33b19b.tar
libvpx-6f51672c4ec334e3978301ecb3c6847c2d33b19b.tar.gz
libvpx-6f51672c4ec334e3978301ecb3c6847c2d33b19b.tar.bz2
libvpx-6f51672c4ec334e3978301ecb3c6847c2d33b19b.zip
Properly propagate out of memory errors.
It would otherwise result in an infinite loop. Change-Id: Ic03fb220cc048538bd62dee599653187f2093079
Diffstat (limited to 'vp9/decoder')
-rw-r--r--vp9/decoder/vp9_decoder.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/vp9/decoder/vp9_decoder.c b/vp9/decoder/vp9_decoder.c
index f5da07ea0..6c9c0f73a 100644
--- a/vp9/decoder/vp9_decoder.c
+++ b/vp9/decoder/vp9_decoder.c
@@ -213,8 +213,11 @@ vpx_codec_err_t vp9_set_reference_dec(VP9_COMMON *cm,
// Find an empty frame buffer.
const int free_fb = get_free_fb(cm);
- if (cm->new_fb_idx == INVALID_IDX)
- return VPX_CODEC_MEM_ERROR;
+ if (cm->new_fb_idx == INVALID_IDX) {
+ vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
+ "Unable to find free frame buffer");
+ return cm->error.error_code;
+ }
// Decrease ref_count since it will be increased again in
// ref_cnt_fb() below.
@@ -305,8 +308,11 @@ int vp9_receive_compressed_data(VP9Decoder *pbi,
&frame_bufs[cm->new_fb_idx].raw_frame_buffer);
// Find a free frame buffer. Return error if can not find any.
cm->new_fb_idx = get_free_fb(cm);
- if (cm->new_fb_idx == INVALID_IDX)
- return VPX_CODEC_MEM_ERROR;
+ if (cm->new_fb_idx == INVALID_IDX) {
+ vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
+ "Unable to find free frame buffer");
+ return cm->error.error_code;
+ }
// Assign a MV array to the frame buffer.
cm->cur_frame = &pool->frame_bufs[cm->new_fb_idx];