[FFmpeg-devel] [PATCH] avformat/apetag: tag values are unsigned

Dan Sanders sandersd at google.com
Fri Apr 19 03:12:14 EEST 2019


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


More information about the ffmpeg-devel mailing list