Commit c84e40d9 authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

fftools/ffmpeg_mux_init: Return error upon error

Currently it may return an uninitialized value.
Introduced in 840f2bc1.
Fixes Coverity issue #1603565.
Reviewed-by: 's avatarAnton Khirnov <anton@khirnov.net>
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
parent a0ff31e7
......@@ -3022,10 +3022,14 @@ static int parse_forced_key_frames(void *log, KeyframeForceCtx *kf,
unsigned int nb_ch = mux->fc->nb_chapters;
int j;
if (nb_ch > INT_MAX - size ||
!(pts = av_realloc_f(pts, size += nb_ch - 1,
sizeof(*pts))))
if (nb_ch > INT_MAX - size) {
ret = AVERROR(ERANGE);
goto fail;
}
size += nb_ch - 1;
pts = av_realloc_f(pts, size, sizeof(*pts));
if (!pts)
return AVERROR(ENOMEM);
if (p[8]) {
ret = av_parse_time(&t, p + 8, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment