Skip to content

Commit

Permalink
Destroy input frame on GMP encode on error conditions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanhugg committed Jul 1, 2014
1 parent 76bd633 commit e4a2fad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions module/gmp-openh264.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ class OpenH264VideoEncoder : public GMPVideoEncoder {
assert (!frameTypes.empty());
if (frameTypes.empty()) {
GMPLOG (GL_ERROR, "No frame types provided");
inputImage->Destroy();
return GMPVideoGenericErr;
}

Expand Down Expand Up @@ -366,6 +367,7 @@ class OpenH264VideoEncoder : public GMPVideoEncoder {
GMPVideoErr err = host_->CreateFrame (kGMPEncodedVideoFrame, &ftmp);
if (err != GMPVideoNoErr) {
GMPLOG (GL_ERROR, "Error creating encoded frame");
frame->Destroy();
return;
}

Expand All @@ -389,6 +391,7 @@ class OpenH264VideoEncoder : public GMPVideoEncoder {
if (err != GMPVideoNoErr) {
GMPLOG (GL_ERROR, "Error allocating frame data");
f->Destroy();
frame->Destroy();
return;
}

Expand Down

0 comments on commit e4a2fad

Please sign in to comment.