ref: dce954119995e8242ff99d134988d1fc730a8d4f
parent: 19273b1ae5b593807332d553f6949298e4cc527d
parent: e4a2fad99b20319653e42f10409729b995c05c3e
author: ruil2 <ruil2@cisco.com>
date: Wed Jul 2 10:01:08 EDT 2014
Merge pull request #1055 from ethanhugg/frameleakonerror Destroy input frame on GMP encode on error conditions.
--- a/module/gmp-openh264.cpp
+++ b/module/gmp-openh264.cpp
@@ -261,6 +261,7 @@
assert (!frameTypes.empty());
if (frameTypes.empty()) {
GMPLOG (GL_ERROR, "No frame types provided");
+ inputImage->Destroy();
return GMPVideoGenericErr;
}
@@ -366,6 +367,7 @@
GMPVideoErr err = host_->CreateFrame (kGMPEncodedVideoFrame, &ftmp);
if (err != GMPVideoNoErr) {
GMPLOG (GL_ERROR, "Error creating encoded frame");
+ frame->Destroy();
return;
}
@@ -389,6 +391,7 @@
if (err != GMPVideoNoErr) {
GMPLOG (GL_ERROR, "Error allocating frame data");
f->Destroy();
+ frame->Destroy();
return;
}