mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-21 22:40:18 +01:00
ffmpeg: Replace av_realloc by av_realloc_f when relevant.
Also mark with a visible comment "FIXME realloc failure" places where av_realloc seems to lack a proper test for failure. Signed-off-by: Nicolas George <nicolas.george@normalesup.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
committed by
Michael Niedermayer
parent
5cd754bca2
commit
1d3b280e71
3
ffmpeg.c
3
ffmpeg.c
@@ -3303,6 +3303,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc)
|
|||||||
av_log(NULL, AV_LOG_FATAL, "error parsing rc_override\n");
|
av_log(NULL, AV_LOG_FATAL, "error parsing rc_override\n");
|
||||||
exit_program(1);
|
exit_program(1);
|
||||||
}
|
}
|
||||||
|
/* FIXME realloc failure */
|
||||||
video_enc->rc_override=
|
video_enc->rc_override=
|
||||||
av_realloc(video_enc->rc_override,
|
av_realloc(video_enc->rc_override,
|
||||||
sizeof(RcOverride)*(i+1));
|
sizeof(RcOverride)*(i+1));
|
||||||
@@ -3474,7 +3475,7 @@ static int copy_chapters(InputFile *ifile, OutputFile *ofile, int copy_metadata)
|
|||||||
av_dict_copy(&out_ch->metadata, in_ch->metadata, 0);
|
av_dict_copy(&out_ch->metadata, in_ch->metadata, 0);
|
||||||
|
|
||||||
os->nb_chapters++;
|
os->nb_chapters++;
|
||||||
os->chapters = av_realloc(os->chapters, sizeof(AVChapter)*os->nb_chapters);
|
os->chapters = av_realloc_f(os->chapters, os->nb_chapters, sizeof(AVChapter));
|
||||||
if (!os->chapters)
|
if (!os->chapters)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
os->chapters[os->nb_chapters - 1] = out_ch;
|
os->chapters[os->nb_chapters - 1] = out_ch;
|
||||||
|
|||||||
Reference in New Issue
Block a user