[FFmpeg-devel] [PATCH] avformat/mux: fix overflow in case one of dts in not set

Michael Niedermayer michael at niedermayer.cc
Thu Sep 30 14:54:18 EEST 2021


On Thu, Sep 30, 2021 at 12:36:17PM +0200, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavformat/mux.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/mux.c b/libavformat/mux.c
> index 2053a5636e..583328b123 100644
> --- a/libavformat/mux.c
> +++ b/libavformat/mux.c
> @@ -949,7 +949,7 @@ int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
>              last_dts = av_rescale_q(last->pkt.dts,
>                                      st->time_base,
>                                      AV_TIME_BASE_Q);
> -            delta_dts = FFMAX(delta_dts, last_dts - top_dts);
> +            delta_dts = FFMAX(delta_dts, (top_dts == AV_NOPTS_VALUE || last_dts == AV_NOPTS_VALUE) ? 0 : last_dts - top_dts);
>          }

In which case are packets without DTS interleaved by DTS ?

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship: All citizens are under surveillance, all their steps and
actions recorded, for the politicians to enforce control.
Democracy: All politicians are under surveillance, all their steps and
actions recorded, for the citizens to enforce control.
-------------- 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/20210930/8f2f0d35/attachment.sig>


More information about the ffmpeg-devel mailing list