Remove .gitignore do nothing is ignored.
[synfig.git] / synfig-core / trunk / src / modules / mptr_mplayer / mptr_mplayer.cpp
index e143a85..9e3d547 100644 (file)
@@ -1,8 +1,10 @@
-/*! ========================================================================
-** Synfig
-** ppm Target Module
-** $Id: mptr_mplayer.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+/* === S Y N F I G ========================================================= */
+/*!    \file mptr_mplayer.cpp
+**     \brief ppm Target Module
 **
+**     $Id$
+**
+**     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
 **
 **     This package is free software; you can redistribute it and/or
@@ -14,6 +16,7 @@
 **     but WITHOUT ANY WARRANTY; without even the implied warranty of
 **     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 **     General Public License for more details.
+**     \endlegal
 **
 ** === N O T E S ===========================================================
 **
@@ -69,6 +72,9 @@ mplayer_mptr::~mplayer_mptr()
 bool
 mplayer_mptr::GetFrame(Time time, synfig::Surface &surface, synfig::ProgressCallback *)
 {
+
+#error This code has vulnerabilites: arbitrary shell command execution and tmpfile issues
+
        int ret;
        ret=system(
                strprintf("/usr/local/bin/mencoder \"%s\" -ovc rawrgb -ss %f -endpos 0 -nosound -o /tmp/tmp.synfig.rgbdata | grep \"VIDEO\" > /tmp/tmp.synfig.size",
@@ -95,12 +101,12 @@ mplayer_mptr::GetFrame(Time time, synfig::Surface &surface, synfig::ProgressCall
                cerr<<"unable to open /tmp/tmp.synfig.size"<<endl;
                return false;
        }
-       
+
        int w=4,h=4,x,y;
        char bleh[500];
-       
+
        fscanf(sizefile,"%s %s %dx%d",bleh,bleh,&w,&h);
-       
+
        cerr<<strprintf("w:%d, h:%d, time:%f",w,h,time)<<endl;
        fseek(rgbfile,2047+3*8,SEEK_CUR);
        surface.set_wh(w,h);
@@ -111,7 +117,7 @@ mplayer_mptr::GetFrame(Time time, synfig::Surface &surface, synfig::ProgressCall
                                b=(unsigned char)fgetc(rgbfile),
                                g=(unsigned char)fgetc(rgbfile),
                                r=(unsigned char)fgetc(rgbfile);
-                               
+
                        surface[h-y-1][x]=Color(
                                (float)r/255.0,
                                (float)g/255.0,
@@ -119,9 +125,9 @@ mplayer_mptr::GetFrame(Time time, synfig::Surface &surface, synfig::ProgressCall
                                1.0
                        );
                }
-       
+
        fclose(rgbfile);
        fclose(sizefile);
-       
+
        return true;
 }