forked from forks/ffprobe-wasm
Forgot to cleanup ffmpeg memory allocations in get_file_info and get_frames.
This commit is contained in:
@@ -131,6 +131,7 @@ FileInfoResponse get_file_info() {
|
|||||||
r.streams.push_back(stream);
|
r.streams.push_back(stream);
|
||||||
free(fourcc);
|
free(fourcc);
|
||||||
}
|
}
|
||||||
|
avformat_close_input(&pFormatContext);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,7 +231,12 @@ FramesResponse get_frames(int offset) {
|
|||||||
}
|
}
|
||||||
frame_count++;
|
frame_count++;
|
||||||
}
|
}
|
||||||
|
av_packet_unref(pPacket);
|
||||||
}
|
}
|
||||||
|
avformat_close_input(&pFormatContext);
|
||||||
|
av_packet_free(&pPacket);
|
||||||
|
av_frame_free(&pFrame);
|
||||||
|
avcodec_free_context(&pCodecContext);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user