From dde9cafaceaecd97861b07d0e47e305c143bd451 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sun, 13 Jul 2014 05:01:53 -0700 Subject: [PATCH] Fix potentially dereferenced null pointer --- libobs/obs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libobs/obs.c b/libobs/obs.c index 306ed19b3..aa1791163 100644 --- a/libobs/obs.c +++ b/libobs/obs.c @@ -607,10 +607,6 @@ bool obs_reset_video(struct obs_video_info *ovi) struct obs_core_video *video = &obs->video; - /* align to multiple-of-two and SSE alignment sizes */ - ovi->output_width &= 0xFFFFFFFC; - ovi->output_height &= 0xFFFFFFFE; - stop_video(); obs_free_video(); @@ -619,6 +615,10 @@ bool obs_reset_video(struct obs_video_info *ovi) return true; } + /* align to multiple-of-two and SSE alignment sizes */ + ovi->output_width &= 0xFFFFFFFC; + ovi->output_height &= 0xFFFFFFFE; + if (!video->graphics && !obs_init_graphics(ovi)) return false;