gnash-commit
[Top][All Lists]
Advanced

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

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


From: Tomas Groth
Subject: [Gnash-commit] gnash ChangeLog libbase/embedVideoDecoderFfmpeg... [release-0-8-0]
Date: Fri, 08 Jun 2007 21:54:39 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Branch:         release-0-8-0
Changes by:     Tomas Groth <tgc>       07/06/08 21:54:39

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&only_with_tag=release-0-8-0&r1=1.3451.2.51&r2=1.3451.2.52
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/embedVideoDecoderFfmpeg.cpp?cvsroot=gnash&only_with_tag=release-0-8-0&r1=1.13.4.4&r2=1.13.4.5
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/embedVideoDecoderFfmpeg.h?cvsroot=gnash&only_with_tag=release-0-8-0&r1=1.4.4.1&r2=1.4.4.2

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3451.2.51
retrieving revision 1.3451.2.52
diff -u -b -r1.3451.2.51 -r1.3451.2.52
--- ChangeLog   8 Jun 2007 21:12:46 -0000       1.3451.2.51
+++ ChangeLog   8 Jun 2007 21:54:38 -0000       1.3451.2.52
@@ -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>
 
        * libbase/embedVideoDecoderGst.{cpp,h}: Store decodedFrame

Index: libbase/embedVideoDecoderFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/embedVideoDecoderFfmpeg.cpp,v
retrieving revision 1.13.4.4
retrieving revision 1.13.4.5
diff -u -b -r1.13.4.4 -r1.13.4.5
--- libbase/embedVideoDecoderFfmpeg.cpp 8 Jun 2007 18:12:24 -0000       1.13.4.4
+++ libbase/embedVideoDecoderFfmpeg.cpp 8 Jun 2007 21:54:38 -0000       1.13.4.5
@@ -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.4.4.1
retrieving revision 1.4.4.2
diff -u -b -r1.4.4.1 -r1.4.4.2
--- libbase/embedVideoDecoderFfmpeg.h   6 Jun 2007 15:44:13 -0000       1.4.4.1
+++ libbase/embedVideoDecoderFfmpeg.h   8 Jun 2007 21:54:38 -0000       1.4.4.2
@@ -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.4.4.1 2007/06/06 15:44:13 tgc Exp $
+// $Id: embedVideoDecoderFfmpeg.h,v 1.4.4.2 2007/06/08 21:54:38 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]