We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bdcda92 commit f348b62Copy full SHA for f348b62
src/encoder.rs
@@ -172,6 +172,9 @@ impl<W: Write> Encoder<W> {
172
///
173
/// Note: This function also writes a control extension if necessary.
174
pub fn write_frame(&mut self, frame: &Frame<'_>) -> Result<(), EncodingError> {
175
+ if frame.buffer.len() < usize::from(frame.width) * usize::from(frame.height) {
176
+ return Err(io::Error::new(io::ErrorKind::InvalidInput, "frame.buffer is too small for its width/height").into());
177
+ }
178
self.write_frame_header(frame)?;
179
self.write_image_block(&frame.buffer)
180
}
0 commit comments