From a7ea0736197ffdde1dc4909ed41429cb674a1ae7 Mon Sep 17 00:00:00 2001 From: Erin Moon Date: Fri, 21 Sep 2018 10:49:03 -0500 Subject: [PATCH] scaling and resampling contexts: fix null checks https://github.com/meh/rust-ffmpeg/commit/dc6ace91ec73b14953b4157af2b1c4c2156c5354 Fixes #1. --- src/software/resampling/context.rs | 2 +- src/software/scaling/context.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/software/resampling/context.rs b/src/software/resampling/context.rs index bae2bfd..ed0749c 100644 --- a/src/software/resampling/context.rs +++ b/src/software/resampling/context.rs @@ -55,7 +55,7 @@ impl Context { ptr::null_mut(), ); - if ptr.is_null() { + if !ptr.is_null() { match swr_init(ptr) { e if e < 0 => Err(Error::from(e)), diff --git a/src/software/scaling/context.rs b/src/software/scaling/context.rs index e0aa4d7..4c73280 100644 --- a/src/software/scaling/context.rs +++ b/src/software/scaling/context.rs @@ -56,7 +56,7 @@ impl Context { ptr::null_mut(), ); - if ptr.is_null() { + if !ptr.is_null() { Ok(Context { ptr: ptr,