Commit 77c19ea3 authored by Michael Spanier's avatar Michael Spanier

kvideo: fix memory leak

commented out matlab save, it has a valgrind/memory issue

fixed pFrame not being properly deleted
parent c0c7a175
Pipeline #21785801 passed with stages
in 5 minutes and 52 seconds
......@@ -410,9 +410,10 @@ KObject* kvideo_frame_to_kimage_decoded (KObject* kobj)
rgbFrame->height = codecCtx->height;
ret = av_image_alloc(rgbFrame->data, rgbFrame->linesize,codecCtx->width,
codecCtx->height,target_format, buffer_size_alignment);
printf("Here!!!!!!!!!!!!!1\n");
if (ret < 0) {
return NULL;
av_frame_free(&rgbFrame);
return NULL;
}
sws_scale(swCtx, (const uint8_t *const *)&kvid->pFrame->data,
......@@ -422,6 +423,7 @@ KObject* kvideo_frame_to_kimage_decoded (KObject* kobj)
KObject* img = _frame_to_kimage(rgbFrame);
av_freep(rgbFrame->data);
av_frame_free(&rgbFrame);
return img;
......
......@@ -129,7 +129,7 @@ int main (int argc, char** argv)
print_info(vid);
save_frame_tiff(vid);
save_raw_frame_matlab(vid);
//save_raw_frame_matlab(vid);
/* cleanup */
kobject_release(vid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment