shithub: openh264

Download patch

ref: e4a2fad99b20319653e42f10409729b995c05c3e
parent: 76bd633d915b0373903a2c94fba8eb8d755e56d8
author: Ethan Hugg <ehugg@cisco.com>
date: Tue Jul 1 05:35:10 EDT 2014

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;
     }