* [FFmpeg-devel] [PATCH 02/10] avformat/jacosubdec: Use 64bit for abs
2024-03-26 0:11 [FFmpeg-devel] [PATCH 01/10] avformat/concatdec: Check user_duration sum Michael Niedermayer
@ 2024-03-26 0:11 ` Michael Niedermayer
2024-03-26 0:11 ` [FFmpeg-devel] [PATCH 03/10] avformat/mov: use 64bit for intermediate for rounding Michael Niedermayer
` (8 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Michael Niedermayer @ 2024-03-26 0:11 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 62276/clusterfuzz-testcase-minimized-ffmpeg_dem_JACOSUB_fuzzer-5401294942371840
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavformat/jacosubdec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/jacosubdec.c b/libavformat/jacosubdec.c
index 447397b6a77..dabb298a264 100644
--- a/libavformat/jacosubdec.c
+++ b/libavformat/jacosubdec.c
@@ -150,7 +150,7 @@ static int get_shift(unsigned timeres, const char *buf)
}
ret = (int64_t)h*3600 + (int64_t)m*60 + s;
- if (FFABS(ret) > (INT64_MAX - FFABS(d)) / timeres)
+ if (FFABS(ret) > (INT64_MAX - FFABS((int64_t)d)) / timeres)
return 0;
ret = sign * (ret * timeres + d);
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 13+ messages in thread
* [FFmpeg-devel] [PATCH 03/10] avformat/mov: use 64bit for intermediate for rounding
2024-03-26 0:11 [FFmpeg-devel] [PATCH 01/10] avformat/concatdec: Check user_duration sum Michael Niedermayer
2024-03-26 0:11 ` [FFmpeg-devel] [PATCH 02/10] avformat/jacosubdec: Use 64bit for abs Michael Niedermayer
@ 2024-03-26 0:11 ` Michael Niedermayer
2024-03-26 0:11 ` [FFmpeg-devel] [PATCH 04/10] avformat/timecode: use 64bit for intermediate for rounding in fps_from_frame_rate() Michael Niedermayer
` (7 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Michael Niedermayer @ 2024-03-26 0:11 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Fixes: signed integer overflow: 1768972133 + 968491058 cannot be represented in type 'int'
Fixes: 62276/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4802790784303104
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavformat/mov.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index f954b924a02..e5e704caeb1 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -8993,7 +8993,7 @@ static int mov_read_timecode_track(AVFormatContext *s, AVStream *st)
/* 60 fps content have tmcd_nb_frames set to 30 but tc_rate set to 60, so
* we multiply the frame number with the quotient.
* See tickets #9492, #9710. */
- rounded_tc_rate = (tc_rate.num + tc_rate.den / 2) / tc_rate.den;
+ rounded_tc_rate = (tc_rate.num + tc_rate.den / 2LL) / tc_rate.den;
/* Work around files where tmcd_nb_frames is rounded down from frame rate
* instead of up. See ticket #5978. */
if (tmcd_nb_frames == tc_rate.num / tc_rate.den &&
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 13+ messages in thread
* [FFmpeg-devel] [PATCH 04/10] avformat/timecode: use 64bit for intermediate for rounding in fps_from_frame_rate()
2024-03-26 0:11 [FFmpeg-devel] [PATCH 01/10] avformat/concatdec: Check user_duration sum Michael Niedermayer
2024-03-26 0:11 ` [FFmpeg-devel] [PATCH 02/10] avformat/jacosubdec: Use 64bit for abs Michael Niedermayer
2024-03-26 0:11 ` [FFmpeg-devel] [PATCH 03/10] avformat/mov: use 64bit for intermediate for rounding Michael Niedermayer
@ 2024-03-26 0:11 ` Michael Niedermayer
2024-03-26 0:11 ` [FFmpeg-devel] [PATCH 05/10] avformat/rpl: Use 64bit for total_audio_size and check it Michael Niedermayer
` (6 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Michael Niedermayer @ 2024-03-26 0:11 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Fixes: 62276/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4802790784303104
Fixes: signed integer overflow: 1768972133 + 968491058 cannot be represented in type 'int'
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavutil/timecode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavutil/timecode.c b/libavutil/timecode.c
index b93f05b4b82..bd879bd3cc0 100644
--- a/libavutil/timecode.c
+++ b/libavutil/timecode.c
@@ -210,7 +210,7 @@ static int fps_from_frame_rate(AVRational rate)
{
if (!rate.den || !rate.num)
return -1;
- return (rate.num + rate.den/2) / rate.den;
+ return (rate.num + rate.den/2LL) / rate.den;
}
int av_timecode_check_frame_rate(AVRational rate)
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 13+ messages in thread
* [FFmpeg-devel] [PATCH 05/10] avformat/rpl: Use 64bit for total_audio_size and check it
2024-03-26 0:11 [FFmpeg-devel] [PATCH 01/10] avformat/concatdec: Check user_duration sum Michael Niedermayer
` (2 preceding siblings ...)
2024-03-26 0:11 ` [FFmpeg-devel] [PATCH 04/10] avformat/timecode: use 64bit for intermediate for rounding in fps_from_frame_rate() Michael Niedermayer
@ 2024-03-26 0:11 ` Michael Niedermayer
2024-03-26 0:11 ` [FFmpeg-devel] [PATCH 06/10] avformat/sbgdec: Check for negative duration Michael Niedermayer
` (5 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Michael Niedermayer @ 2024-03-26 0:11 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Fixes: 62276/clusterfuzz-testcase-minimized-ffmpeg_dem_RPL_fuzzer-4677434693517312
Fixes: signed integer overflow: 5555555555555555556 * 8 cannot be represented in type 'long long'
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavformat/rpl.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavformat/rpl.c b/libavformat/rpl.c
index 3f10e51d482..09d0b68f748 100644
--- a/libavformat/rpl.c
+++ b/libavformat/rpl.c
@@ -118,7 +118,7 @@ static int rpl_read_header(AVFormatContext *s)
AVIOContext *pb = s->pb;
RPLContext *rpl = s->priv_data;
AVStream *vst = NULL, *ast = NULL;
- int total_audio_size;
+ int64_t total_audio_size;
int error = 0;
const char *endptr;
char audio_type[RPL_LINE_LENGTH];
@@ -303,6 +303,8 @@ static int rpl_read_header(AVFormatContext *s)
if (ast)
av_add_index_entry(ast, offset + video_size, total_audio_size,
audio_size, audio_size * 8, 0);
+ if (total_audio_size/8 + (uint64_t)audio_size >= INT64_MAX/8)
+ return AVERROR_INVALIDDATA;
total_audio_size += audio_size * 8;
}
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 13+ messages in thread
* [FFmpeg-devel] [PATCH 06/10] avformat/sbgdec: Check for negative duration
2024-03-26 0:11 [FFmpeg-devel] [PATCH 01/10] avformat/concatdec: Check user_duration sum Michael Niedermayer
` (3 preceding siblings ...)
2024-03-26 0:11 ` [FFmpeg-devel] [PATCH 05/10] avformat/rpl: Use 64bit for total_audio_size and check it Michael Niedermayer
@ 2024-03-26 0:11 ` Michael Niedermayer
2024-03-26 0:11 ` [FFmpeg-devel] [PATCH 07/10] avformat/wavdec: sanity check channels and bps before using them for block_align Michael Niedermayer
` (4 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Michael Niedermayer @ 2024-03-26 0:11 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Fixes: signed integer overflow: 9223372036854775807 - -8000000 cannot be represented in type 'long'
Fixes: 62276/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-5133181743136768
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavformat/sbgdec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/sbgdec.c b/libavformat/sbgdec.c
index bc2469afd17..e60eb1481ea 100644
--- a/libavformat/sbgdec.c
+++ b/libavformat/sbgdec.c
@@ -387,7 +387,7 @@ static int parse_options(struct sbg_parser *p)
case 'L':
FORWARD_ERROR(parse_optarg(p, opt, &oarg));
r = str_to_time(oarg.s, &p->scs.opt_duration);
- if (oarg.e != oarg.s + r) {
+ if (oarg.e != oarg.s + r || p->scs.opt_duration < 0) {
snprintf(p->err_msg, sizeof(p->err_msg),
"syntax error for option -L");
return AVERROR_INVALIDDATA;
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 13+ messages in thread
* [FFmpeg-devel] [PATCH 07/10] avformat/wavdec: sanity check channels and bps before using them for block_align
2024-03-26 0:11 [FFmpeg-devel] [PATCH 01/10] avformat/concatdec: Check user_duration sum Michael Niedermayer
` (4 preceding siblings ...)
2024-03-26 0:11 ` [FFmpeg-devel] [PATCH 06/10] avformat/sbgdec: Check for negative duration Michael Niedermayer
@ 2024-03-26 0:11 ` Michael Niedermayer
2024-03-27 9:42 ` Anton Khirnov
2024-03-26 0:11 ` [FFmpeg-devel] [PATCH 08/10] avformat/wavdec: satuarte next_tag_ofs, data_end Michael Niedermayer
` (3 subsequent siblings)
9 siblings, 1 reply; 13+ messages in thread
From: Michael Niedermayer @ 2024-03-26 0:11 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Fixes: 62276/clusterfuzz-testcase-minimized-ffmpeg_dem_W64_fuzzer-4704044498944000
Fixes: signed integer overflow: 520464 * 8224 cannot be represented in type 'int'
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavformat/wavdec.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index 668c8adc36b..89855670d9c 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -34,6 +34,7 @@
#include "libavutil/log.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
+#include "libavcodec/internal.h"
#include "avformat.h"
#include "avio.h"
#include "avio_internal.h"
@@ -908,7 +909,9 @@ static int w64_read_header(AVFormatContext *s)
if (ret < 0)
return ret;
avio_skip(pb, FFALIGN(size, INT64_C(8)) - size);
- if (st->codecpar->block_align) {
+ if (st->codecpar->block_align &&
+ st->codecpar->ch_layout.nb_channels < FF_SANE_NB_CHANNELS &&
+ st->codecpar->bits_per_coded_sample < 128) {
int block_align = st->codecpar->block_align;
block_align = FFMAX(block_align,
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [FFmpeg-devel] [PATCH 07/10] avformat/wavdec: sanity check channels and bps before using them for block_align
2024-03-26 0:11 ` [FFmpeg-devel] [PATCH 07/10] avformat/wavdec: sanity check channels and bps before using them for block_align Michael Niedermayer
@ 2024-03-27 9:42 ` Anton Khirnov
2024-03-27 20:56 ` Michael Niedermayer
0 siblings, 1 reply; 13+ messages in thread
From: Anton Khirnov @ 2024-03-27 9:42 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Quoting Michael Niedermayer (2024-03-26 01:11:48)
> Fixes: 62276/clusterfuzz-testcase-minimized-ffmpeg_dem_W64_fuzzer-4704044498944000
> Fixes: signed integer overflow: 520464 * 8224 cannot be represented in type 'int'
>
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
> libavformat/wavdec.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
> index 668c8adc36b..89855670d9c 100644
> --- a/libavformat/wavdec.c
> +++ b/libavformat/wavdec.c
> @@ -34,6 +34,7 @@
> #include "libavutil/log.h"
> #include "libavutil/mathematics.h"
> #include "libavutil/opt.h"
> +#include "libavcodec/internal.h"
> #include "avformat.h"
> #include "avio.h"
> #include "avio_internal.h"
> @@ -908,7 +909,9 @@ static int w64_read_header(AVFormatContext *s)
> if (ret < 0)
> return ret;
> avio_skip(pb, FFALIGN(size, INT64_C(8)) - size);
> - if (st->codecpar->block_align) {
> + if (st->codecpar->block_align &&
> + st->codecpar->ch_layout.nb_channels < FF_SANE_NB_CHANNELS &&
I objected to this approach.
--
Anton Khirnov
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [FFmpeg-devel] [PATCH 07/10] avformat/wavdec: sanity check channels and bps before using them for block_align
2024-03-27 9:42 ` Anton Khirnov
@ 2024-03-27 20:56 ` Michael Niedermayer
0 siblings, 0 replies; 13+ messages in thread
From: Michael Niedermayer @ 2024-03-27 20:56 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 1890 bytes --]
On Wed, Mar 27, 2024 at 10:42:31AM +0100, Anton Khirnov wrote:
> Quoting Michael Niedermayer (2024-03-26 01:11:48)
> > Fixes: 62276/clusterfuzz-testcase-minimized-ffmpeg_dem_W64_fuzzer-4704044498944000
> > Fixes: signed integer overflow: 520464 * 8224 cannot be represented in type 'int'
> >
> > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> > libavformat/wavdec.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
> > index 668c8adc36b..89855670d9c 100644
> > --- a/libavformat/wavdec.c
> > +++ b/libavformat/wavdec.c
> > @@ -34,6 +34,7 @@
> > #include "libavutil/log.h"
> > #include "libavutil/mathematics.h"
> > #include "libavutil/opt.h"
> > +#include "libavcodec/internal.h"
> > #include "avformat.h"
> > #include "avio.h"
> > #include "avio_internal.h"
> > @@ -908,7 +909,9 @@ static int w64_read_header(AVFormatContext *s)
> > if (ret < 0)
> > return ret;
> > avio_skip(pb, FFALIGN(size, INT64_C(8)) - size);
> > - if (st->codecpar->block_align) {
> > + if (st->codecpar->block_align &&
> > + st->codecpar->ch_layout.nb_channels < FF_SANE_NB_CHANNELS &&
>
> I objected to this approach.
Maybe that was your intend but what you actually wrote and what i understood
was that you objected to adding a field to AVFormatContext
For reference:
> is anyone against adding a max_channels field to AVFormatContext or something
> like that ?
I am.
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
It is a danger to trust the dream we wish for rather than
the science we have, -- Dr. Kenneth Brown
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 13+ messages in thread
* [FFmpeg-devel] [PATCH 08/10] avformat/wavdec: satuarte next_tag_ofs, data_end
2024-03-26 0:11 [FFmpeg-devel] [PATCH 01/10] avformat/concatdec: Check user_duration sum Michael Niedermayer
` (5 preceding siblings ...)
2024-03-26 0:11 ` [FFmpeg-devel] [PATCH 07/10] avformat/wavdec: sanity check channels and bps before using them for block_align Michael Niedermayer
@ 2024-03-26 0:11 ` Michael Niedermayer
2024-03-26 0:11 ` [FFmpeg-devel] [PATCH 09/10] avformat/matroskadec: Check timescale Michael Niedermayer
` (2 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Michael Niedermayer @ 2024-03-26 0:11 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Fixes: signed integer overflow: 5053074104798691550 + 5053074104259715104 cannot be represented in type 'long'
Fixes: 62276/clusterfuzz-testcase-minimized-ffmpeg_dem_WAV_fuzzer-6515315309936640
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavformat/wavdec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index 89855670d9c..0fed1ee6398 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -453,7 +453,7 @@ static int wav_read_header(AVFormatContext *s)
}
if (rf64 || bw64) {
- next_tag_ofs = wav->data_end = avio_tell(pb) + data_size;
+ next_tag_ofs = wav->data_end = av_sat_add64(avio_tell(pb), data_size);
} else if (size != 0xFFFFFFFF) {
data_size = size;
next_tag_ofs = wav->data_end = size ? next_tag_ofs : INT64_MAX;
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 13+ messages in thread
* [FFmpeg-devel] [PATCH 09/10] avformat/matroskadec: Check timescale
2024-03-26 0:11 [FFmpeg-devel] [PATCH 01/10] avformat/concatdec: Check user_duration sum Michael Niedermayer
` (6 preceding siblings ...)
2024-03-26 0:11 ` [FFmpeg-devel] [PATCH 08/10] avformat/wavdec: satuarte next_tag_ofs, data_end Michael Niedermayer
@ 2024-03-26 0:11 ` Michael Niedermayer
2024-03-26 0:11 ` [FFmpeg-devel] [PATCH 10/10] avformat/westwood_vqa: Fix 2g packets Michael Niedermayer
2024-03-26 19:19 ` [FFmpeg-devel] [PATCH 01/10] avformat/concatdec: Check user_duration sum Michael Niedermayer
9 siblings, 0 replies; 13+ messages in thread
From: Michael Niedermayer @ 2024-03-26 0:11 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Fixes: 3.82046e+18 is outside the range of representable values of type 'unsigned int'
Fixes: 62276/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-6381436594421760
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavformat/matroskadec.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 8897fd622c6..8e031c618ba 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -3195,6 +3195,10 @@ static int matroska_parse_tracks(AVFormatContext *s)
track->time_scale);
track->time_scale = 1.0;
}
+
+ if (matroska->time_scale * track->time_scale > UINT_MAX)
+ return AVERROR_INVALIDDATA;
+
avpriv_set_pts_info(st, 64, matroska->time_scale * track->time_scale,
1000 * 1000 * 1000); /* 64 bit pts in ns */
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 13+ messages in thread
* [FFmpeg-devel] [PATCH 10/10] avformat/westwood_vqa: Fix 2g packets
2024-03-26 0:11 [FFmpeg-devel] [PATCH 01/10] avformat/concatdec: Check user_duration sum Michael Niedermayer
` (7 preceding siblings ...)
2024-03-26 0:11 ` [FFmpeg-devel] [PATCH 09/10] avformat/matroskadec: Check timescale Michael Niedermayer
@ 2024-03-26 0:11 ` Michael Niedermayer
2024-03-26 19:19 ` [FFmpeg-devel] [PATCH 01/10] avformat/concatdec: Check user_duration sum Michael Niedermayer
9 siblings, 0 replies; 13+ messages in thread
From: Michael Niedermayer @ 2024-03-26 0:11 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Fixes: signed integer overflow: 2147483424 * 2 cannot be represented in type 'int'
Fixes: 62276/clusterfuzz-testcase-minimized-ffmpeg_dem_WSVQA_fuzzer-4576211411795968
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavformat/westwood_vqa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/westwood_vqa.c b/libavformat/westwood_vqa.c
index 954710a6f00..3a31e3f5e8e 100644
--- a/libavformat/westwood_vqa.c
+++ b/libavformat/westwood_vqa.c
@@ -262,7 +262,7 @@ static int wsvqa_read_packet(AVFormatContext *s,
break;
case SND2_TAG:
/* 2 samples/byte, 1 or 2 samples per frame depending on stereo */
- pkt->duration = (chunk_size * 2) / wsvqa->channels;
+ pkt->duration = (chunk_size * 2LL) / wsvqa->channels;
break;
}
break;
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [FFmpeg-devel] [PATCH 01/10] avformat/concatdec: Check user_duration sum
2024-03-26 0:11 [FFmpeg-devel] [PATCH 01/10] avformat/concatdec: Check user_duration sum Michael Niedermayer
` (8 preceding siblings ...)
2024-03-26 0:11 ` [FFmpeg-devel] [PATCH 10/10] avformat/westwood_vqa: Fix 2g packets Michael Niedermayer
@ 2024-03-26 19:19 ` Michael Niedermayer
9 siblings, 0 replies; 13+ messages in thread
From: Michael Niedermayer @ 2024-03-26 19:19 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 875 bytes --]
On Tue, Mar 26, 2024 at 01:11:42AM +0100, Michael Niedermayer wrote:
> Fixes: 62276/clusterfuzz-testcase-minimized-ffmpeg_dem_CONCAT_fuzzer-6434245599690752
> Fixes: signed integer overflow: 9223372026773000000 + 22337000000 cannot be represented in type 'long'
>
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
> libavformat/concatdec.c | 2 ++
> 1 file changed, 2 insertions(+)
if there are no objections i will apply this patchset before making the 7.0 branch
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 13+ messages in thread