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: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-1787-gdb62681
Date: Mon, 09 Sep 2013 13:21:12 +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  db6268172bdb1bf5ab0fb3d03425d0ed7c7b65cf (commit)
      from  0a5e717f665864025aa0abc14898b5bc33fd574e (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=db6268172bdb1bf5ab0fb3d03425d0ed7c7b65cf


commit db6268172bdb1bf5ab0fb3d03425d0ed7c7b65cf
Author: Sandro Santilli <address@hidden>
Date:   Mon Sep 9 15:20:14 2013 +0200

    Fix memory leak in AudioDecoderFfmpeg::decodeFrame
    
    See https://savannah.gnu.org/bugs/index.php?39987

diff --git a/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp 
b/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
index b194f54..4a3a9b0 100644
--- a/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
+++ b/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
@@ -505,6 +505,9 @@ AudioDecoderFfmpeg::decodeFrame(const boost::uint8_t* input,
         return NULL;
     }
 
+    boost::int16_t* output = outPtr;
+
+
 #ifdef GNASH_DEBUG_AUDIO_DECODING
     log_debug("AudioDecoderFfmpeg: about to decode %d bytes; "
         "ctx->channels:%d, ctx->frame_size:%d",
@@ -520,6 +523,7 @@ AudioDecoderFfmpeg::decodeFrame(const boost::uint8_t* input,
     AVFrame *frm = avcodec_alloc_frame();
     if (!frm) {
         log_error(_("failed to allocate frame."));
+        av_free(output);
         return NULL;
     }
     int tmp = avcodec_decode_audio4(_audioCodecCtx, frm, &got_frm, &pkt);
@@ -539,6 +543,7 @@ AudioDecoderFfmpeg::decodeFrame(const boost::uint8_t* input,
         if (static_cast<int>(outSize) < data_size) {
             log_error(_("output buffer size is too small for the current frame 
"
                 "(%d < %d)"), outSize, data_size);
+            av_free(output);
             return NULL;
         }
 
@@ -570,6 +575,7 @@ AudioDecoderFfmpeg::decodeFrame(const boost::uint8_t* input,
         log_error(_("Upgrading ffmpeg/libavcodec might fix this issue."));
         outputSize = 0;
         av_freep(&frm);
+        av_free(output);
         return NULL;
     }
 
@@ -645,6 +651,7 @@ AudioDecoderFfmpeg::decodeFrame(const boost::uint8_t* input,
     }
 
     outputSize = outSize;
+    av_free(output);
     return reinterpret_cast<uint8_t*>(outPtr);
 }
 

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

Summary of changes:
 libmedia/ffmpeg/AudioDecoderFfmpeg.cpp |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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