Skip to content

Commit a37dbf1

Browse files
committed
fix invalid DPD image access (indirectly revealed by #318)
1 parent 82b6340 commit a37dbf1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libde265/dpb.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ int decoded_picture_buffer::new_image(std::shared_ptr<const seq_parameter_set> s
245245

246246
// --- allocate new image ---
247247

248+
if (free_image_buffer_idx<0) {
249+
return free_image_buffer_idx;
250+
}
251+
248252
de265_image* img = dpb[free_image_buffer_idx];
249253

250254
int w = sps->pic_width_in_luma_samples;

0 commit comments

Comments
 (0)