[FFmpeg-devel] [PATCH] avformat/apetag: tag values are unsigned
Fixes: UBSan runtime error
Found-by: Clusterfuzz
---
libavformat/apetag.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/libavformat/apetag.c b/libavformat/apetag.c
index cdc602e1a9..2991f57d5d 100644
--- a/libavformat/apetag.c
+++ b/libavformat/apetag.c
@@ -29,10 +29,10 @@
#include "apetag.h"
#include "internal.h"
-#define APE_TAG_FLAG_CONTAINS_HEADER (1 << 31)
-#define APE_TAG_FLAG_LACKS_FOOTER (1 << 30)
-#define APE_TAG_FLAG_IS_HEADER(1 << 29)
-#define APE_TAG_FLAG_IS_BINARY(1 << 1)
+#define APE_TAG_FLAG_CONTAINS_HEADER (1U << 31)
+#define APE_TAG_FLAG_LACKS_FOOTER (1U << 30)
+#define APE_TAG_FLAG_IS_HEADER(1U << 29)
+#define APE_TAG_FLAG_IS_BINARY(1U << 1)
static int ape_tag_read_field(AVFormatContext *s)
{
--
2.21.0.392.gf8f6787159e-goog
___
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avformat/apetag: tag values are unsigned
> > +#define APE_TAG_FLAG_CONTAINS_HEADER (1U << 31) > > Isn't it enough with this one only? Yes, only APE_TAG_FLAG_CONTAINS_HEADER is problematic. I changed all of them because the tags are only used in unsigned contexts anyway. ___ ffmpeg-devel mailing list [email protected] https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
[FFmpeg-devel] [PATCH] libavformat/mov: limit nb_frames_for_fps to INT_MAX
--- Begin Message ---
Fixes: UBSan runtime error
Found-by: Clusterfuzz
---
libavformat/mov.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index d5ce077e63..7e7de5962d 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2940,7 +2940,7 @@ static int mov_read_stts(MOVContext *c,
AVIOContext *pb, MOVAtom atom)
if (duration > 0 &&
duration <= INT64_MAX - sc->duration_for_fps &&
-total_sample_count <= INT64_MAX - sc->nb_frames_for_fps
+total_sample_count <= INT_MAX - sc->nb_frames_for_fps
) {
sc->duration_for_fps += duration;
sc->nb_frames_for_fps += total_sample_count;
--
2.21.0.593.g511ec345e18-goog
--- End Message ---
___
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".
