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>
pull/389/head
Andreas Rheinhardt 2 years ago
parent 2732d0507c
commit f456c192d9
  1. 1
      libavcodec/libx264.c

@ -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;
}

Loading…
Cancel
Save