Announcement

Collapse
No announcement yet.

The bug with E4M2 of the DarkPlaces was fixed by Berserker

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • The bug with E4M2 of the DarkPlaces was fixed by Berserker

    The bug with E4M2 of the DarkPlaces engine was fixed by a good russian programmer Berserker

    DP_Patched.rar ������� � �����@Mail.Ru


    The bug of the DarkPlaces engine on E4M2:
    In the file svbsp.c were defined the limit for the poligon points:
    #define MAX_SVBSP_POLYGONPOINTS 16

    In this file:

    typedef struct svbsp_polygon_s
    {
    float points[MAX_SVBSP_POLYGONPOINTS][3];
    //unsigned char splitflags[MAX_SVBSP_POLYGONPOINTS];
    int facesplitflag;
    int numpoints;
    }
    svbsp_polygon_t;

    And more:

    int SVBSP_AddPolygon(svbsp_t *b, int numpoints, const float *points, int insertoccluder, void (*fragmentcallback)(void *fragmentcallback_pointer1, int fragmentcallback_number1, svbsp_t *b, int numpoints, const float *points), void *fragmentcallback_pointer1, int fragmentcallback_number1)
    {
    int i;
    int nodenum;
    svbsp_polygon_t poly;
    // don't even consider an empty polygon
    // note we still allow points and lines to be tested...
    if (numpoints < 1)
    return 0;

    poly.numpoints = numpoints;
    for (i = 0;i < numpoints;i++)
    {
    poly.points[0] = points[i*3+0];
    poly.points[1] = points[i*3+1];
    poly.points[2] = points[i*3+2];
    //poly.splitflags = 0; // this edge is a valid BSP splitter - clipped edges are not (because they lie on a bsp plane)
    poly.facesplitflag = 0; // this face is a valid BSP Splitter - if it lies on a bsp plane it is not
    }
    ...

    At the moment of the crash on E4M2 numpoints = 24, much higher than MAX_SVBSP_POLYGONPOINTS.

    The solution is:

    1) First way is to:

    #define MAX_SVBSP_POLYGONPOINTS 32 /// Berserker: was 16

    2) Second way is to add check:

    int SVBSP_AddPolygon(svbsp_t *b, int numpoints, const float *points, int insertoccluder, void (*fragmentcallback)(void *fragmentcallback_pointer1, int fragmentcallback_number1, svbsp_t *b, int numpoints, const float *points), void *fragmentcallback_pointer1, int fragmentcallback_number1)
    {
    int i;
    int nodenum;
    svbsp_polygon_t poly;
    // don't even consider an empty polygon
    // note we still allow points and lines to be tested...
    if (numpoints < 1)
    return 0;

    /// Berserker's fix: crash on E4M2
    if (numpoints > MAX_SVBSP_POLYGONPOINTS)
    return 0;
    /// End of fix

    poly.numpoints = numpoints;
    for (i = 0;i < numpoints;i++)
    {
    poly.points[0] = points[i*3+0];
    poly.points[1] = points[i*3+1];
    poly.points[2] = points[i*3+2];
    //poly.splitflags = 0; // this edge is a valid BSP splitter - clipped edges are not (because they lie on a bsp plane)
    poly.facesplitflag = 0; // this face is a valid BSP Splitter - if it lies on a bsp plane it is not
    }
    ...

    You can download the source and exe files here:
    DP_Patched.rar ������� � �����@Mail.Ru

  • #2
    The validity of the bug, and/or patch may be truthful, though blindly downloading an executable NOT from the official DARKPLACES website, would be a warning to all to use at your own risk.
    www.quakeone.com/qrack | www.quakeone.com/cax| http://en.twitch.tv/sputnikutah

    Comment


    • #3
      Berserker as in Q2 Berserker?

      Comment


      • #4
        Originally posted by Maphfus View Post
        The bug with E4M2 of the DarkPlaces engine was fixed by a good russian programmer Berserker
        This bug was already fixed (autobuilds and betas)... But I haven't made a new "stable" build yet.

        Comment


        • #5
          e|------------------------0---------------
          B|---------------0^1----------------1----
          G|---------------2------2------0^2-------
          D|---------------2-------2--2-------------
          A|---------------0------------------------
          E|----------------------------------------

          Comment


          • #6
            Originally posted by LordHavoc View Post
            This bug was already fixed (autobuilds and betas)... But I haven't made a new "stable" build yet.
            I e-mailed you month ago and described the bug, but you

            didn't reply me.

            Comment


            • #7
              Originally posted by metchsteekle View Post
              Berserker as in Q2 Berserker?
              Yes.

              Comment


              • #8
                Russian? That must be malware! Doesn't anyone remember the cold war?
                Quake 1 Singleplayer Maps and Mods

                Comment


                • #9
                  well it was a 1st post..
                  www.quakeone.com/qrack | www.quakeone.com/cax| http://en.twitch.tv/sputnikutah

                  Comment


                  • #10
                    Originally posted by R00k View Post
                    The validity of the bug, and/or patch may be truthful, though blindly downloading an executable NOT from the official DARKPLACES website, would be a warning to all to use at your own risk.
                    If i say - patch created by developer of Q2Bers (Q2Bers is really cool port of Q2, such as Q2 XP), you feel better?
                    Small jsHexen2 and retex project http://hexen2retex.narod.ru/

                    Comment


                    • #11
                      ^^^^^^^^^^^^^
                      Well that information is coming after the fact. That was the guy's first post and the link says this:

                      DP_Patched.rar ������� � �����@Mail.Ru

                      and is linked to this:

                      http://files.mail.ru/U4MH5Z

                      Sorry but that just screams trouble to me. I agree with rook on the first initial assessment. Furthermore, if i cant read it and it comes from another country (.RU) i will most likely never click on that link.

                      Comment


                      • #12
                        Originally posted by Disco Rockstar View Post
                        ^^^^^^^^^^^^^
                        Well that information is coming after the fact. That was the guy's first post and the link says this:

                        DP_Patched.rar ������� � �����@Mail.Ru

                        and is linked to this:

                        DP_Patched.rar ������� � �����@Mail.Ru
                        That link says nothing more than "DP_Patched.rar - Download From [email protected]". [email protected] is one of the biggest analogues of RapidShare in the russian segment of the internet.

                        Still, your position about downloading executables from the unknown sources is absolutely right. My primary job is the CEO position in a small company offering IT outsourcing services. If all the computer users working for client companies were thinking like you the life of our specialists (and all IT helpdesk engineers and admins in general) would be much easier and happy.

                        Comment


                        • #13
                          Never trust a Russian.

                          Comment


                          • #14
                            You should never trust any executable. Putting countries or hosts into the mix is just fear, uncertainty and doubt (and I love how it is USA vs Russia here). Remember how recently Baker's machine was infected and he accidentally uploaded an infected file? You can never be certain any file will be safe. Not an executable, not any other file you "open" (due to exploits). Always remember to wear a tinfoil hat.
                            Quake 1 Singleplayer Maps and Mods

                            Comment


                            • #15
                              Originally posted by bFeared View Post
                              Never trust a Russian.
                              Don't play STALKER or Metro 2033!!!
                              Don't use Render Monkey!
                              Remove Half-Life 2 from HDD!
                              Hands off from WinRar!!!

                              Is a big conspiracy, anywhere hidden hands from Moscow, they not only put worms in your PC, they also use hidden lasers from deep space every night, just blast human brains peoples from democracy's countries.

                              So, save your brains now, use Tin Foil Hat!

                              http://upload.wikimedia.org/wikipedi...TinFoilHat.jpg
                              Last edited by jeank; 09-28-2010, 04:10 AM.
                              Small jsHexen2 and retex project http://hexen2retex.narod.ru/

                              Comment

                              Working...
                              X