Free av_frames when done with them

pull/12/head
Andri Yngvason 2022-06-29 15:59:56 +00:00
parent 469db1ba3a
commit f6a634f30b
1 changed files with 2 additions and 0 deletions

View File

@ -88,6 +88,7 @@ static void vnc_client_clear_av_frames(struct vnc_client* self)
{ {
for (int i = 0; i < self->n_av_frames; ++i) { for (int i = 0; i < self->n_av_frames; ++i) {
av_frame_unref(self->av_frames[i]->frame); av_frame_unref(self->av_frames[i]->frame);
av_frame_free(&self->av_frames[i]->frame);
free(self->av_frames[i]); free(self->av_frames[i]);
} }
self->n_av_frames = 0; self->n_av_frames = 0;
@ -141,6 +142,7 @@ static rfbBool vnc_client_handle_open_h264_rect(rfbClient* client,
struct vnc_av_frame* f = calloc(1, sizeof(*f)); struct vnc_av_frame* f = calloc(1, sizeof(*f));
if (!f) { if (!f) {
av_frame_unref(frame); av_frame_unref(frame);
av_frame_free(&frame);
return false; return false;
} }