summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibaut Mattern <tmattern@users.sourceforge.net>2004-12-16 19:26:34 +0000
committerThibaut Mattern <tmattern@users.sourceforge.net>2004-12-16 19:26:34 +0000
commit70c171b8b06fa4935f13bdd83d14027ac473dbac (patch)
tree4d874f567acfdb99c256cbf5c3e65f5a1ccec487
parent4a92f5cbb43ef017728d86857538cab54b29cfde (diff)
downloadxine-lib-70c171b8b06fa4935f13bdd83d14027ac473dbac.tar.gz
xine-lib-70c171b8b06fa4935f13bdd83d14027ac473dbac.tar.bz2
Do not trust ffmpeg and check length validity.
Should fix some segfaults. CVS patchset: 7265 CVS date: 2004/12/16 19:26:34
-rw-r--r--src/libffmpeg/video_decoder.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libffmpeg/video_decoder.c b/src/libffmpeg/video_decoder.c
index 3d2b9d456..0bd87a8f4 100644
--- a/src/libffmpeg/video_decoder.c
+++ b/src/libffmpeg/video_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_decoder.c,v 1.38 2004/12/16 13:59:05 mroi Exp $
+ * $Id: video_decoder.c,v 1.39 2004/12/16 19:26:34 tmattern Exp $
*
* xine video decoder plugin using ffmpeg
*
@@ -988,7 +988,7 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
this->size);
}
}
- if (len < 0) {
+ if ((len < 0) || (len > this->size)) {
xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
"ffmpeg_video_dec: error decompressing frame\n");
this->size = 0;