mirror of
https://github.com/encounter/rust-ffmpeg.git
synced 2026-07-10 21:18:39 -07:00
software/scaling/context: allocate the output if it's empty
This commit is contained in:
@@ -100,6 +100,12 @@ impl Context {
|
||||
if input.format() != self.input.format || input.width() != self.input.width || input.height() != self.input.height {
|
||||
return Err(Error::InputChanged);
|
||||
}
|
||||
|
||||
unsafe {
|
||||
if output.is_empty() {
|
||||
output.alloc(self.output.format, self.output.width, self.output.height);
|
||||
}
|
||||
}
|
||||
|
||||
if output.format() != self.output.format || output.width() != self.output.width || output.height() != self.output.height {
|
||||
return Err(Error::OutputChanged);
|
||||
|
||||
Reference in New Issue
Block a user