diff --git a/libde265/dpb.cc b/libde265/dpb.cc index 68ce7b6f..af448e32 100644 --- a/libde265/dpb.cc +++ b/libde265/dpb.cc @@ -245,6 +245,10 @@ int decoded_picture_buffer::new_image(std::shared_ptr s // --- allocate new image --- + if (free_image_buffer_idx<0) { + return free_image_buffer_idx; + } + de265_image* img = dpb[free_image_buffer_idx]; int w = sps->pic_width_in_luma_samples;