Skip to content

Commit

Permalink
[codeVideoEncoderFFmpeg] Fix memleak introduced by commit 62bdd8f
Browse files Browse the repository at this point in the history
The buffer holding encoder output is allocated internally by libavcodec and needs to be unreferenced before the AVPacket is destroyed
  • Loading branch information
eumagga0x2a committed Feb 1, 2020
1 parent 2e18a90 commit 5843ad3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,9 @@ int ADM_coreVideoEncoderFFmpeg::encodeWrapper(AVFrame *in,ADMBitstream *out)
memcpy(out->data,pkt.data,pkt.size);
lavPtsFromPacket=pkt.pts; // some encoders don't set pts in coded_frame
packetFlags=pkt.flags;
return pkt.size;
r=pkt.size;
av_packet_unref(&pkt);
return r;
}
/**
*
Expand Down

0 comments on commit 5843ad3

Please sign in to comment.