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 46df766 commit 3afdb7eCopy full SHA for 3afdb7e
vobsub/src/sub.rs
@@ -353,6 +353,15 @@ fn subtitle(raw_data: &[u8], base_time: f64) -> Result<Subtitle> {
353
alpha = alpha.or(Some(a));
354
}
355
ControlCommand::Coordinates(ref c) => {
356
+ // Check for weird bounding boxes. Ideally we
357
+ // would do this while parsing, but I can't
358
+ // figure out how to get nom to do what I want.
359
+ // Later on, we assume that all bounding boxes
360
+ // have non-negative width and height and we'll
361
+ // crash if they don't.
362
+ if c.x2 <= c.x1 || c.y2 <= c.y1 {
363
+ return Err("invalid bounding box".into());
364
+ }
365
coordinates = coordinates.or(Some(c.clone()));
366
367
ControlCommand::RleOffsets(r) => {
0 commit comments