Fix memleak due to not freeing the opts dict except on error.

pull/3779/head
Isaac Connor 2023-10-26 13:44:02 -04:00
parent d7bb9674e3
commit 558aed0561
1 changed files with 1 additions and 1 deletions

View File

@ -517,9 +517,9 @@ int FfmpegCamera::OpenFfmpeg() {
while ((e = av_dict_get(opts, "", e, AV_DICT_IGNORE_SUFFIX)) != nullptr) {
Warning("Option %s not recognized by ffmpeg", e->key);
}
av_dict_free(&opts);
if (ret < 0) {
Error("Unable to open codec for video stream from %s", mMaskedPath.c_str());
av_dict_free(&opts);
return -1;
}
Debug(1, "Thread count? %d", mVideoCodecContext->thread_count);