gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Bastiaan Jacques
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-2181-g84f8bfd
Date: Wed, 04 Feb 2015 21:11:21 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  84f8bfda226cbebd3fdeb43760936023b88b7b63 (commit)
       via  10eb924c3329e84c3a06a0ece9533dfdaee85c99 (commit)
      from  094dc45b2dc1005b41243722042a4ecca8cf535e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=84f8bfda226cbebd3fdeb43760936023b88b7b63


commit 84f8bfda226cbebd3fdeb43760936023b88b7b63
Author: Bastiaan Jacques <address@hidden>
Date:   Wed Feb 4 22:05:40 2015 +0100

    Fix memory leak.
    
    Pointers allocated with av_frame_alloc() must be matched with
    av_frame_free().

diff --git a/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp 
b/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
index 08792f8..c98e2d8 100644
--- a/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
+++ b/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
@@ -476,7 +476,7 @@ AudioDecoderFfmpeg::decodeFrame(const std::uint8_t* input,
     av_init_packet(&pkt);
     pkt.data = const_cast<uint8_t*>(input);
     pkt.size = inputSize;
-    std::unique_ptr<AVFrame, decltype(av_free)*> frm ( FRAMEALLOC(), av_free );
+    std::unique_ptr<AVFrame, FrameDeleter> frm(FRAMEALLOC(), FrameDeleter());
     if (!frm.get()) {
         log_error(_("failed to allocate frame."));
         return nullptr;
diff --git a/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp 
b/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
index d5505cd..20d49b9 100644
--- a/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
+++ b/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
@@ -359,7 +359,7 @@ VideoDecoderFfmpeg::decode(const std::uint8_t* input,
 
     std::unique_ptr<image::GnashImage> ret;
 
-    std::unique_ptr<AVFrame, decltype(av_free)*> frame(FRAMEALLOC(), av_free);
+    std::unique_ptr<AVFrame, FrameDeleter> frame(FRAMEALLOC(), FrameDeleter());
     if ( ! frame ) {
         log_error(_("Out of memory while allocating avcodec frame"));
         return ret;
diff --git a/libmedia/ffmpeg/ffmpegHeaders.h b/libmedia/ffmpeg/ffmpegHeaders.h
index 0741777..53b5b18 100644
--- a/libmedia/ffmpeg/ffmpegHeaders.h
+++ b/libmedia/ffmpeg/ffmpegHeaders.h
@@ -114,8 +114,22 @@ extern "C" {
 
 #define avg_frame_rate r_frame_rate
 #define FRAMEALLOC avcodec_alloc_frame
+struct FrameDeleter
+{
+    void operator()(AVFrame* frame)
+    {
+        av_free(frame);
+    }
+};
 #else
 #define FRAMEALLOC av_frame_alloc
+struct FrameDeleter
+{
+    void operator()(AVFrame* frame)
+    {
+        av_frame_free(&frame);
+    }
+};
 #endif
 
 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,18,102)

http://git.savannah.gnu.org/cgit//commit/?id=10eb924c3329e84c3a06a0ece9533dfdaee85c99


commit 10eb924c3329e84c3a06a0ece9533dfdaee85c99
Author: Bastiaan Jacques <address@hidden>
Date:   Tue Feb 3 01:14:07 2015 +0100

    Cosmetic fixes.

diff --git a/macros/ffmpeg.m4 b/macros/ffmpeg.m4
index c3ef987..d1d8426 100644
--- a/macros/ffmpeg.m4
+++ b/macros/ffmpeg.m4
@@ -609,9 +609,10 @@ dnl | libav  | 0.8 (53.35.0)   S16 | 9   (54.35.0)   FLTP |
           AC_CHECK_LIB(gsm, gsm_destroy, 
[ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -lgsm"])
         fi
       fi
+    else
+      AC_MSG_RESULT(${libgsm})
     fi
 
-    AC_MSG_RESULT(${libgsm})
     ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} ${libgsm}"
     dnl End of GSM library looking }
     
diff --git a/macros/qt4.m4 b/macros/qt4.m4
index 8798dec..a05108c 100644
--- a/macros/qt4.m4
+++ b/macros/qt4.m4
@@ -69,7 +69,9 @@ dnl     fi
         if ${PKG_CONFIG} --exists QtOpenGL; then
           ac_cv_path_qt4_incl="`$PKG_CONFIG --cflags-only-I QtCore QtGui 
QtOpenGL`"
         else
-          ac_cv_path_qt4_incl="`$PKG_CONFIG --cflags-only-I QtCore QtGui`"
+          if ${PKG_CONFIG} --exists QtCore QtGui; then
+            ac_cv_path_qt4_incl="`$PKG_CONFIG --cflags-only-I QtCore QtGui`"
+          fi
         fi
        gnash_qt4_topdir=`echo "${ac_cv_path_qt4_incl}"`
       fi

-----------------------------------------------------------------------

Summary of changes:
 libmedia/ffmpeg/AudioDecoderFfmpeg.cpp |    2 +-
 libmedia/ffmpeg/VideoDecoderFfmpeg.cpp |    2 +-
 libmedia/ffmpeg/ffmpegHeaders.h        |   14 ++++++++++++++
 macros/ffmpeg.m4                       |    3 ++-
 macros/qt4.m4                          |    4 +++-
 5 files changed, 21 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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