codec/encoder/video: also check width and height in encode

This commit is contained in:
meh 2015-10-01 01:28:56 +02:00
parent 56bb62eae3
commit 1497c645be

View File

@ -358,7 +358,7 @@ pub struct Encoder(pub Video);
impl Encoder {
pub fn encode(&mut self, frame: &frame::Video, out: &mut Packet) -> Result<bool, Error> {
unsafe {
if self.format() != frame.format() {
if self.format() != frame.format() || self.width() != frame.width() || self.height() != frame.height() {
return Err(Error::InvalidData);
}