Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 01/13] avformat/flvdec: Use 64bit for sum_flv_tag_size
@ 2022-09-18 17:13 Michael Niedermayer
  2022-09-18 17:13 ` [FFmpeg-devel] [PATCH 02/13] avformat/mxfdec: Check run_in to fit in int and be valid Michael Niedermayer
                   ` (12 more replies)
  0 siblings, 13 replies; 27+ messages in thread
From: Michael Niedermayer @ 2022-09-18 17:13 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Fixes: signed integer overflow: 2138820085 + 16130322 cannot be represented in type 'int'
Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_LIVE_FLV_fuzzer-6704728165187584

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/flvdec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 7f9d7950448..d83edff727c 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -66,7 +66,7 @@ typedef struct FLVContext {
     uint8_t resync_buffer[2*RESYNC_BUFFER_SIZE];
 
     int broken_sizes;
-    int sum_flv_tag_size;
+    int64_t sum_flv_tag_size;
 
     int last_keyframe_stream_index;
     int keyframe_count;
@@ -1032,7 +1032,7 @@ retry:
     type = (avio_r8(s->pb) & 0x1F);
     orig_size =
     size = avio_rb24(s->pb);
-    flv->sum_flv_tag_size += size + 11;
+    flv->sum_flv_tag_size += size + 11LL;
     dts  = avio_rb24(s->pb);
     dts |= (unsigned)avio_r8(s->pb) << 24;
     av_log(s, AV_LOG_TRACE, "type:%d, size:%d, last:%d, dts:%"PRId64" pos:%"PRId64"\n", type, size, last, dts, avio_tell(s->pb));
@@ -1332,7 +1332,7 @@ leave:
             !avio_feof(s->pb) &&
             (last != orig_size || !last) && last != flv->sum_flv_tag_size &&
             !flv->broken_sizes) {
-            av_log(s, AV_LOG_ERROR, "Packet mismatch %d %d %d\n", last, orig_size + 11, flv->sum_flv_tag_size);
+            av_log(s, AV_LOG_ERROR, "Packet mismatch %d %d %"PRId64"\n", last, orig_size + 11, flv->sum_flv_tag_size);
             avio_seek(s->pb, pos + 1, SEEK_SET);
             ret = resync(s);
             av_packet_unref(pkt);
-- 
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] 27+ messages in thread

end of thread, other threads:[~2022-09-23 21:00 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-18 17:13 [FFmpeg-devel] [PATCH 01/13] avformat/flvdec: Use 64bit for sum_flv_tag_size Michael Niedermayer
2022-09-18 17:13 ` [FFmpeg-devel] [PATCH 02/13] avformat/mxfdec: Check run_in to fit in int and be valid Michael Niedermayer
2022-09-20 11:07   ` Tomas Härdin
2022-09-20 11:20     ` Tomas Härdin
2022-09-21  9:35       ` Michael Niedermayer
2022-09-21 13:23         ` Tomas Härdin
2022-09-21 16:16           ` Michael Niedermayer
2022-09-21 13:25         ` Tomas Härdin
2022-09-21 16:20           ` Michael Niedermayer
2022-09-21 18:56           ` Marton Balint
2022-09-22 13:29             ` Tomas Härdin
2022-09-18 17:14 ` [FFmpeg-devel] [PATCH 03/13] avformat/nutdec: Check fields Michael Niedermayer
2022-09-18 17:14 ` [FFmpeg-devel] [PATCH 04/13] avformat/rmdec: check tag_size Michael Niedermayer
2022-09-18 17:14 ` [FFmpeg-devel] [PATCH 05/13] avformat/sbgdec: clamp end_ts Michael Niedermayer
2022-09-18 17:14 ` [FFmpeg-devel] [PATCH 06/13] avformat/sbgdec: Check ts_int in genrate_intervals Michael Niedermayer
2022-09-18 17:14 ` [FFmpeg-devel] [PATCH 07/13] avformat/sdsdec: Use av_rescale() to avoid intermediate overflow in duration calculation Michael Niedermayer
2022-09-18 17:14 ` [FFmpeg-devel] [PATCH 08/13] avformat/xwma: Use av_rescale() for duration computation Michael Niedermayer
2022-09-18 17:14 ` [FFmpeg-devel] [PATCH 09/13] avformat/rpl: Use 64bit " Michael Niedermayer
2022-09-18 17:14 ` [FFmpeg-devel] [PATCH 10/13] avformat/vividas: Check packet size Michael Niedermayer
2022-09-22 13:18   ` Anton Khirnov
2022-09-22 16:12     ` Michael Niedermayer
2022-09-18 17:14 ` [FFmpeg-devel] [PATCH 11/13] avformat/spdifdec: Use 64bit to compute bit rate Michael Niedermayer
2022-09-18 17:14 ` [FFmpeg-devel] [PATCH 12/13] avformat/matroskadec: Error out if a timestamp is beyond duration Michael Niedermayer
2022-09-18 17:14 ` [FFmpeg-devel] [PATCH 13/13] avformat/westwood_vqa: Check chunk size Michael Niedermayer
2022-09-22 13:01   ` Anton Khirnov
2022-09-22 16:28     ` Michael Niedermayer
2022-09-23 21:00 ` [FFmpeg-devel] [PATCH 01/13] avformat/flvdec: Use 64bit for sum_flv_tag_size Michael Niedermayer

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git