[FFmpeg-devel] [PATCH 2/2] lavfi/avf_concat: check input timestamp.
Michael Niedermayer
michael at niedermayer.cc
Sun Aug 23 11:19:50 EEST 2020
On Sun, Aug 09, 2020 at 12:56:53PM +0200, Nicolas George wrote:
> If an input has an undefined timestamp, the computation
> for silence at stitches can overflow.
>
> Partial fix for trac ticket #8843.
>
> Signed-off-by: Nicolas George <george at nsup.org>
> ---
> libavfilter/avf_concat.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
>
> "Partial fix" means it does not segfault and exits with an error instead.
>
> The actual problem in this ticket is amix sending a frame with no PTS.
>
>
> diff --git a/libavfilter/avf_concat.c b/libavfilter/avf_concat.c
> index 246628498a..f376f72754 100644
> --- a/libavfilter/avf_concat.c
> +++ b/libavfilter/avf_concat.c
> @@ -179,6 +179,10 @@ static int push_frame(AVFilterContext *ctx, unsigned in_no, AVFrame *buf)
> AVFilterLink *outlink = ctx->outputs[out_no];
> struct concat_in *in = &cat->in[in_no];
>
> + if (buf->pts == AV_NOPTS_VALUE) {
> + av_log(ctx, AV_LOG_ERROR, "Frame without timestamp on input %d\n", in_no);
> + return AVERROR(EINVAL);
> + }
what if the timestamp is "AV_NOPTS_VALUE + 1" ?
would that work or overflow ?
also could the filter not use the previous frame pts + "duration" when a PTS
is unavailable (maybe that would make sense in some cases) (with a warning)
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200823/c0586c8c/attachment.sig>
More information about the ffmpeg-devel
mailing list