mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
midifile: error won invalid track size
When the track data would exceed the file size, return an error.
This commit is contained in:
parent
6a516b9505
commit
0ddf80d470
1 changed files with 3 additions and 0 deletions
|
|
@ -118,6 +118,9 @@ static int read_mtrk(struct midi_file *mf, struct midi_track *track)
|
||||||
track->size = parse_be32(mf->p + 4);
|
track->size = parse_be32(mf->p + 4);
|
||||||
|
|
||||||
mf->p = track->data + track->size;
|
mf->p = track->data + track->size;
|
||||||
|
if (mf->p > mf->data + mf->size)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue