From 1497c645be0c11a9ce2c25ec745f18c047ac679f Mon Sep 17 00:00:00 2001 From: meh Date: Thu, 1 Oct 2015 01:28:56 +0200 Subject: [PATCH] codec/encoder/video: also check width and height in encode --- src/codec/encoder/video.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codec/encoder/video.rs b/src/codec/encoder/video.rs index f0eefab..0aa4548 100644 --- a/src/codec/encoder/video.rs +++ b/src/codec/encoder/video.rs @@ -358,7 +358,7 @@ pub struct Encoder(pub Video); impl Encoder { pub fn encode(&mut self, frame: &frame::Video, out: &mut Packet) -> Result { unsafe { - if self.format() != frame.format() { + if self.format() != frame.format() || self.width() != frame.width() || self.height() != frame.height() { return Err(Error::InvalidData); }