[MPlayer-cvslog] r32702 - trunk/stream/stream.h

reimar subversion at mplayerhq.hu
Sun Dec 12 12:45:47 CET 2010


Author: reimar
Date: Sun Dec 12 12:45:47 2010
New Revision: 32702

Log:
Add validity check for stream_seek argument to avoid a integer overflow
for huge negative values that would break the internal state of the stream buffer.

Modified:
   trunk/stream/stream.h

Modified: trunk/stream/stream.h
==============================================================================
--- trunk/stream/stream.h	Sun Dec 12 11:37:15 2010	(r32701)
+++ trunk/stream/stream.h	Sun Dec 12 12:45:47 2010	(r32702)
@@ -292,6 +292,10 @@ inline static int stream_seek(stream_t *
 
   mp_dbg(MSGT_DEMUX, MSGL_DBG3, "seek to 0x%qX\n",(long long)pos);
 
+  if (pos < 0) {
+    mp_msg(MSGT_DEMUX, MSGL_ERR, "Invalid seek to negative position!\n");
+    pos = 0;
+  }
   if(pos<s->pos){
     off_t x=pos-(s->pos-s->buf_len);
     if(x>=0){


More information about the MPlayer-cvslog mailing list