diff --git a/libde265/decctx.cc b/libde265/decctx.cc index d046e0c6..6e96c402 100644 --- a/libde265/decctx.cc +++ b/libde265/decctx.cc @@ -2088,7 +2088,9 @@ bool decoder_context::process_slice_segment_header(slice_segment_header* hdr, img->PicState = UsedForShortTermReference; *err = process_reference_picture_set(hdr); - return false; + if (*err != DE265_OK) { + return false; + } } img->PicState = UsedForShortTermReference; diff --git a/libde265/dpb.cc b/libde265/dpb.cc index af448e32..77581a65 100644 --- a/libde265/dpb.cc +++ b/libde265/dpb.cc @@ -237,7 +237,7 @@ int decoded_picture_buffer::new_image(std::shared_ptr s // create a new image slot if no empty slot remaining - if (free_image_buffer_idx == -1) { + if (free_image_buffer_idx == -DE265_ERROR_IMAGE_BUFFER_FULL) { free_image_buffer_idx = dpb.size(); dpb.push_back(new de265_image); }