Don't read beyond the last cell in a chapter (fixes invalid memory access)

Original commit message from CVS:
Don't read beyond the last cell in a chapter (fixes invalid memory access)
This commit is contained in:
Tim-Philipp Müller 2005-01-17 16:17:26 +00:00
parent 50b7c32b3e
commit be2a70cf23
2 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2005-01-17 Tim-Philipp Müller <tim at centricular dot net>
* ext/dvdread/dvdreadsrc.c: (_read):
Don't read beyond the last cell in a chapter (fixes
invalid memory access)
2005-01-17 Tim-Philipp Müller <tim at centricular dot net>
* ext/dvdread/stream_labels.c:

View file

@ -777,10 +777,17 @@ _read (DVDReadSrcPrivate * priv, int angle, int new_seek, GstBuffer * buf)
if (new_seek)
priv->cur_cell = priv->start_cell;
again:
if (priv->cur_cell < priv->last_cell) {
if (priv->new_cell || new_seek) {
if (!new_seek)
if (!new_seek) {
priv->cur_cell = priv->next_cell;
if (priv->cur_cell >= priv->last_cell) {
GST_LOG ("last cell in chapter");
goto again;
}
}
/* take angle into account */
if (priv->cur_pgc->cell_playback[priv->cur_cell].block_type