mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-09 05:38:58 +00:00
gst/wavparse/gstwavparse.c: Make sure we don't read beyond the end of the file (#345232).
Original commit message from CVS: Patch by: Mark Nauwelaerts <manauw at skynet be> * gst/wavparse/gstwavparse.c: (gst_wavparse_perform_seek): Make sure we don't read beyond the end of the file (#345232).
This commit is contained in:
parent
bf9e04e2db
commit
d2eeafad7c
2 changed files with 17 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2006-06-18 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
Patch by: Mark Nauwelaerts <manauw at skynet be>
|
||||||
|
|
||||||
|
* gst/wavparse/gstwavparse.c: (gst_wavparse_perform_seek):
|
||||||
|
Make sure we don't read beyond the end of the file (#345232).
|
||||||
|
|
||||||
2006-06-17 Tim-Philipp Müller <tim at centricular dot net>
|
2006-06-17 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* configure.ac:
|
* configure.ac:
|
||||||
|
|
|
@ -769,10 +769,10 @@ gst_wavparse_perform_seek (GstWavParse * wav, GstEvent * event)
|
||||||
gboolean res;
|
gboolean res;
|
||||||
gdouble rate;
|
gdouble rate;
|
||||||
GstEvent *newsegment;
|
GstEvent *newsegment;
|
||||||
GstFormat format;
|
GstFormat format, bformat;
|
||||||
GstSeekFlags flags;
|
GstSeekFlags flags;
|
||||||
GstSeekType cur_type = GST_SEEK_TYPE_NONE, stop_type;
|
GstSeekType cur_type = GST_SEEK_TYPE_NONE, stop_type;
|
||||||
gint64 cur, stop;
|
gint64 cur, stop, upstream_size;
|
||||||
gboolean flush;
|
gboolean flush;
|
||||||
gboolean update;
|
gboolean update;
|
||||||
GstSegment seeksegment;
|
GstSegment seeksegment;
|
||||||
|
@ -843,6 +843,14 @@ gst_wavparse_perform_seek (GstWavParse * wav, GstEvent * event)
|
||||||
} else {
|
} else {
|
||||||
wav->end_offset = wav->datasize + wav->datastart;
|
wav->end_offset = wav->datasize + wav->datastart;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* make sure filesize is not exceeded due to rounding errors or so,
|
||||||
|
* same precaution as in _stream_headers */
|
||||||
|
bformat = GST_FORMAT_BYTES;
|
||||||
|
if (gst_pad_query_peer_duration (wav->sinkpad, &bformat, &upstream_size)) {
|
||||||
|
wav->end_offset = MIN (wav->end_offset, upstream_size);
|
||||||
|
}
|
||||||
|
|
||||||
wav->offset = MIN (wav->offset, wav->end_offset);
|
wav->offset = MIN (wav->offset, wav->end_offset);
|
||||||
wav->dataleft = wav->end_offset - wav->offset;
|
wav->dataleft = wav->end_offset - wav->offset;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue