diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 9dd7d83ef1976c2ce417a74bdce249078a5bf4d2..f38cab7eb7b853c0ace68b4e4861c044cbaa7348 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -330,7 +330,7 @@ extern int motion_estimation_method;
 #define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
 #define CODEC_FLAG_INTERLACED_ME  0x20000000 ///< interlaced motion estimation
 #define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< will reserve space for SVCD scan offset user data
-#define CODEC_FLAG_CLOSED_GOP     0x80000000
+#define CODEC_FLAG_CLOSED_GOP     ((int)0x80000000)
 #define CODEC_FLAG2_FAST          0x00000001 ///< allow non spec compliant speedup tricks
 #define CODEC_FLAG2_STRICT_GOP    0x00000002 ///< strictly enforce GOP size
 #define CODEC_FLAG2_NO_OUTPUT     0x00000004 ///< skip bitstream encoding