Fixed a few sanity checks.
Change-Id: Ieec4a7be5945dc6de192e2d8292ab978baf47f53 (cherry picked from commit 2096296421c7fa56abb49470c0fbe7c4337b8a71)
This commit is contained in:
parent
204cde580a
commit
8a782c7eac
@ -243,7 +243,7 @@ static void swap_frame_buffers(VP9Decoder *pbi) {
|
|||||||
decrease_ref_count(old_idx, frame_bufs, pool);
|
decrease_ref_count(old_idx, frame_bufs, pool);
|
||||||
|
|
||||||
// Release the reference frame in reference map.
|
// Release the reference frame in reference map.
|
||||||
if ((mask & 1) && old_idx >= 0) {
|
if (mask & 1) {
|
||||||
decrease_ref_count(old_idx, frame_bufs, pool);
|
decrease_ref_count(old_idx, frame_bufs, pool);
|
||||||
}
|
}
|
||||||
cm->ref_frame_map[ref_index] = cm->next_ref_frame_map[ref_index];
|
cm->ref_frame_map[ref_index] = cm->next_ref_frame_map[ref_index];
|
||||||
@ -350,7 +350,7 @@ int vp9_receive_compressed_data(VP9Decoder *pbi,
|
|||||||
decrease_ref_count(old_idx, frame_bufs, pool);
|
decrease_ref_count(old_idx, frame_bufs, pool);
|
||||||
|
|
||||||
// Release the reference frame in reference map.
|
// Release the reference frame in reference map.
|
||||||
if ((mask & 1) && old_idx >= 0) {
|
if (mask & 1) {
|
||||||
decrease_ref_count(old_idx, frame_bufs, pool);
|
decrease_ref_count(old_idx, frame_bufs, pool);
|
||||||
}
|
}
|
||||||
++ref_index;
|
++ref_index;
|
||||||
|
@ -128,7 +128,7 @@ void vp9_decoder_remove(struct VP9Decoder *pbi);
|
|||||||
|
|
||||||
static INLINE void decrease_ref_count(int idx, RefCntBuffer *const frame_bufs,
|
static INLINE void decrease_ref_count(int idx, RefCntBuffer *const frame_bufs,
|
||||||
BufferPool *const pool) {
|
BufferPool *const pool) {
|
||||||
if (idx >= 0) {
|
if (idx >= 0 && frame_bufs[idx].ref_count > 0) {
|
||||||
--frame_bufs[idx].ref_count;
|
--frame_bufs[idx].ref_count;
|
||||||
// A worker may only get a free framebuffer index when calling get_free_fb.
|
// A worker may only get a free framebuffer index when calling get_free_fb.
|
||||||
// But the private buffer is not set up until finish decoding header.
|
// But the private buffer is not set up until finish decoding header.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user