avcodec/libx264: Fix leak in case of allocation failure

Fixes Coverity issue #1518906.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2023-03-12 22:51:06 +01:00
parent 2732d0507c
commit f456c192d9

View File

@ -503,6 +503,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (sei_data) {
pic->extra_sei.payloads = av_mallocz(sizeof(pic->extra_sei.payloads[0]));
if (pic->extra_sei.payloads == NULL) {
av_free(sei_data);
ret = AVERROR(ENOMEM);
goto fail;
}