Browse Source

libobs: Add array check for deinterlace logic

Seeing a rare assert on startup for a media source with deinterlacing
already on. Tested with Yadif 2x. Repro is maybe 10% of OBS launches?
jpark37 3 years ago
parent
commit
dd86425559
1 changed files with 2 additions and 1 deletions
  1. 2 1
      libobs/obs-source-deinterlace.c

+ 2 - 1
libobs/obs-source-deinterlace.c

@@ -181,7 +181,8 @@ static inline void deinterlace_get_closest_frames(obs_source_t *s,
 
 		da_erase(s->async_frames, 0);
 
-		if (s->cur_async_frame->prev_frame) {
+		if ((s->async_frames.num > 0) &&
+		    s->cur_async_frame->prev_frame) {
 			s->prev_async_frame = s->cur_async_frame;
 			s->cur_async_frame = s->async_frames.array[0];