Re: [FFmpeg-devel] [PATCH 1/9] avformat/utils: check dts/duration to be representable before using them

2021-06-12 Thread Michael Niedermayer
On Mon, Apr 19, 2021 at 08:23:38PM +0200, Michael Niedermayer wrote:
> Fixes: signed integer overflow: 6854513951393103890 + 3427256975738527712 
> cannot be represented in type 'long'
> Fixes: 
> 32936/clusterfuzz-testcase-minimized-ffmpeg_dem_R3D_fuzzer-5236914752978944
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/utils.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

will apply

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 1/9] avformat/utils: check dts/duration to be representable before using them

2021-04-19 Thread Michael Niedermayer
Fixes: signed integer overflow: 6854513951393103890 + 3427256975738527712 
cannot be represented in type 'long'
Fixes: 
32936/clusterfuzz-testcase-minimized-ffmpeg_dem_R3D_fuzzer-5236914752978944

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavformat/utils.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index d4ec3d0190..26528f2a68 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1243,7 +1243,9 @@ static void update_initial_durations(AVFormatContext *s, 
AVStream *st,
 (pktl->pkt.dts == AV_NOPTS_VALUE ||
  pktl->pkt.dts == st->first_dts ||
  pktl->pkt.dts == RELATIVE_TS_BASE) &&
-!pktl->pkt.duration) {
+!pktl->pkt.duration &&
+av_sat_add64(cur_dts, duration) == cur_dts + (uint64_t)duration
+) {
 pktl->pkt.dts = cur_dts;
 if (!st->internal->avctx->has_b_frames)
 pktl->pkt.pts = cur_dts;
-- 
2.17.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".