codec/encoder/video: also check width and height in encode
This commit is contained in:
parent
56bb62eae3
commit
1497c645be
@ -358,7 +358,7 @@ pub struct Encoder(pub Video);
|
|||||||
impl Encoder {
|
impl Encoder {
|
||||||
pub fn encode(&mut self, frame: &frame::Video, out: &mut Packet) -> Result<bool, Error> {
|
pub fn encode(&mut self, frame: &frame::Video, out: &mut Packet) -> Result<bool, Error> {
|
||||||
unsafe {
|
unsafe {
|
||||||
if self.format() != frame.format() {
|
if self.format() != frame.format() || self.width() != frame.width() || self.height() != frame.height() {
|
||||||
return Err(Error::InvalidData);
|
return Err(Error::InvalidData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user