gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog libbase/embedVideoDecoderFfmpeg...


From: Tomas Groth
Subject: [Gnash-commit] gnash ChangeLog libbase/embedVideoDecoderFfmpeg...
Date: Fri, 08 Jun 2007 21:58:06 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Tomas Groth <tgc>       07/06/08 21:58:06

Modified files:
        .              : ChangeLog 
        libbase        : embedVideoDecoderFfmpeg.cpp 
                         embedVideoDecoderFfmpeg.h 

Log message:
                * libbase/embedVideoDecoderFfmpeg.{cpp,h}: Store decodedFrame
                  in an auto_ptr to avoid possible leaks.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3502&r2=1.3503
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/embedVideoDecoderFfmpeg.cpp?cvsroot=gnash&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/embedVideoDecoderFfmpeg.h?cvsroot=gnash&r1=1.5&r2=1.6

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3502
retrieving revision 1.3503
diff -u -b -r1.3502 -r1.3503
--- ChangeLog   8 Jun 2007 21:40:38 -0000       1.3502
+++ ChangeLog   8 Jun 2007 21:58:04 -0000       1.3503
@@ -1,3 +1,8 @@
+2007-06-08 Tomas Groth Christensen <address@hidden>
+
+       * libbase/embedVideoDecoderFfmpeg.{cpp,h}: Store decodedFrame
+         in an auto_ptr to avoid possible leaks.
+
 2007-06-08 Sandro Santilli <address@hidden>
 
        * server/FreetypeRasterizer.{cpp,h}: Ported truetype

Index: libbase/embedVideoDecoderFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/embedVideoDecoderFfmpeg.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- libbase/embedVideoDecoderFfmpeg.cpp 8 Jun 2007 18:10:32 -0000       1.17
+++ libbase/embedVideoDecoderFfmpeg.cpp 8 Jun 2007 21:58:06 -0000       1.18
@@ -44,8 +44,6 @@
 {
        if (cc) avcodec_close(cc);
 
-       delete decodedFrame;
-
 }
 
 void
@@ -89,9 +87,9 @@
 
        // Determine required buffer size and allocate buffer
        if (outputFormat == YUV) {
-               decodedFrame = new image::yuv(width, height);
+               decodedFrame.reset(new image::yuv(width, height));
        } else if (outputFormat == RGB) {
-               decodedFrame = new image::rgb(width, height);
+               decodedFrame.reset(new image::rgb(width, height));
        }
 }
 
@@ -177,15 +175,14 @@
        // If the size of the video frame changed, adjust.
        // This could happen if the decoded video frame is
        // bigger than the defined SWF videoframe.
-       if (cc->width != width || cc->height != height) {
+       if (static_cast<uint32_t>(cc->width) != width || 
static_cast<uint32_t>(cc->height) != height) {
                width = cc->width;
                height = cc->height;
-               delete decodedFrame;
                if (outputFormat == YUV) {
-                       decodedFrame = new image::yuv(width, height);
+                       decodedFrame.reset(new image::yuv(width, height));
                        ret_image.reset(new image::yuv(width, height));
                } else if (outputFormat == RGB) {
-                       decodedFrame = new image::rgb(width, height);
+                       decodedFrame.reset(new image::rgb(width, height));
                        ret_image.reset(new image::rgb(width, height));
                }
        }
@@ -208,7 +205,7 @@
                }
 
                if (outputFormat == YUV) {
-                       image::yuv* yuvframe = 
static_cast<image::yuv*>(decodedFrame);
+                       image::yuv* yuvframe = 
static_cast<image::yuv*>(decodedFrame.get());
                        int copied = 0;
                        uint8_t* ptr = yuvframe->m_data;
                        for (int i = 0; i < 3 ; i++)

Index: libbase/embedVideoDecoderFfmpeg.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/embedVideoDecoderFfmpeg.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- libbase/embedVideoDecoderFfmpeg.h   6 Jun 2007 15:41:12 -0000       1.5
+++ libbase/embedVideoDecoderFfmpeg.h   8 Jun 2007 21:58:06 -0000       1.6
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-// $Id: embedVideoDecoderFfmpeg.h,v 1.5 2007/06/06 15:41:12 tgc Exp $
+// $Id: embedVideoDecoderFfmpeg.h,v 1.6 2007/06/08 21:58:06 tgc Exp $
 
 #ifndef __EMBEDVIDEODECODERFFMPEG_H__
 #define __EMBEDVIDEODECODERFFMPEG_H__
@@ -76,7 +76,7 @@
        int outputFormat;
 
        /// Last decoded frame
-       image::image_base* decodedFrame;
+       std::auto_ptr<image::image_base> decodedFrame;
 
 };
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]