mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/qsv: Fix leak of options on error
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
e6cdd23bc7
commit
c9ceec1f1f
@ -361,6 +361,7 @@ static int ff_qsv_set_display_handle(AVCodecContext *avctx, QSVSession *qs)
|
|||||||
av_dict_set(&child_device_opts, "driver", "iHD", 0);
|
av_dict_set(&child_device_opts, "driver", "iHD", 0);
|
||||||
|
|
||||||
ret = av_hwdevice_ctx_create(&qs->va_device_ref, AV_HWDEVICE_TYPE_VAAPI, NULL, child_device_opts, 0);
|
ret = av_hwdevice_ctx_create(&qs->va_device_ref, AV_HWDEVICE_TYPE_VAAPI, NULL, child_device_opts, 0);
|
||||||
|
av_dict_free(&child_device_opts);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Failed to create a VAAPI device.\n");
|
av_log(avctx, AV_LOG_ERROR, "Failed to create a VAAPI device.\n");
|
||||||
return ret;
|
return ret;
|
||||||
@ -375,8 +376,6 @@ static int ff_qsv_set_display_handle(AVCodecContext *avctx, QSVSession *qs)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
av_dict_free(&child_device_opts);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif //AVCODEC_QSV_LINUX_SESSION_HANDLE
|
#endif //AVCODEC_QSV_LINUX_SESSION_HANDLE
|
||||||
|
Loading…
Reference in New Issue
Block a user