Skip to content

Commit

Permalink
Always free the receive_frame not on error
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Connor committed Feb 3, 2025
1 parent 55e86c2 commit cfe788e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/zm_packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ int ZMPacket::decode(AVCodecContext *ctx) {
// ret == 0 means EAGAIN
int ret = zm_send_packet_receive_frame(ctx, receive_frame, *packet);
if (ret <= 0) {
av_frame_free(&receive_frame);
if (ret < 0) {
av_frame_free(&receive_frame);
Warning("Unable to receive frame : code %d %s.",
ret, av_make_error_string(ret).c_str());
//if (ret == AVERROR_EOF) zm_terminate = true;
Expand Down

0 comments on commit cfe788e

Please sign in to comment.