-Fixed a minor bug in CL_Video
authorblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 5 Dec 2004 13:58:16 +0000 (13:58 +0000)
committerblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 5 Dec 2004 13:58:16 +0000 (13:58 +0000)
-Changed func_t from int to unsigned int - probably this breaks some things
 but at least it fixes an annoying crash of the DP with the current Nexuiz
 build.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4829 d7cf8633-e32d-0410-b094-e92efae38249

cl_video.c
pr_comp.h
pr_execprogram.h

index 7707dd7..2d6069e 100644 (file)
@@ -208,7 +208,7 @@ void CL_VideoFrame( void ) // update all videos
                        if( realtime - video->lasttime > CLTHRESHOLD )
                                SuspendVideo( video );
                        else if( video->state == CLVIDEO_PAUSE )
-                               video->starttime = realtime + video->framenum * video->framerate;
+                               video->starttime = realtime - video->framenum * video->framerate;
                        else 
                                VideoFrame( video );
 
index 6b35e5c..7a74464 100644 (file)
--- a/pr_comp.h
+++ b/pr_comp.h
@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #ifndef PR_COMP_H
 #define PR_COMP_H
 
-typedef int    func_t;
+typedef unsigned int   func_t;
 typedef int    string_t;
 
 typedef enum {ev_void, ev_string, ev_float, ev_vector, ev_entity, ev_field, ev_function, ev_pointer} etype_t;
index e0e9d24..5089e27 100644 (file)
                                startprofile = profile;
                                pr_xstatement = st - pr_statements;
                                pr_argc = st->op - OP_CALL0;
-                               if (!OPA->function)
+                               if (!OPA->function )
                                        Host_Error("NULL function");
+                               else if (OPA->function > (unsigned) progs->numfunctions)
+                                       Host_Error("Bad function number");
 
                                newf = &pr_functions[OPA->function];