diff --git a/libavcodec/raw.c b/libavcodec/raw.c
index d0cf50d9e8329781c49e7283dba67aaf5e331559..c88830cafc3773f7da7312079dea5be137a88cef 100644
--- a/libavcodec/raw.c
+++ b/libavcodec/raw.c
@@ -52,7 +52,7 @@ const PixelFormatTag ff_raw_pixelFormatTags[] = {
     { PIX_FMT_UYVY422, MKTAG('2', 'v', 'u', 'y') },
     { PIX_FMT_UYVY422, MKTAG('A', 'V', 'U', 'I') }, /* FIXME merge both fields */
 
-    { -1, 0 },
+    { PIX_FMT_NONE, 0 },
 };
 
 unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat fmt)
diff --git a/libavcodec/raw.h b/libavcodec/raw.h
index e600dca395358544302748c523771fe826992541..2fbf2d660530bb9f55b97cd34a25a1d4730847ec 100644
--- a/libavcodec/raw.h
+++ b/libavcodec/raw.h
@@ -30,7 +30,7 @@
 #include "avcodec.h"
 
 typedef struct PixelFormatTag {
-    int pix_fmt;
+    enum PixelFormat pix_fmt;
     unsigned int fourcc;
 } PixelFormatTag;
 
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index 6039f132320b49be8176522e186573cea90d8e19..4590b961bfbebdb2543af393418e5c08ddece267 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -40,7 +40,7 @@ static const PixelFormatTag pixelFormatBpsAVI[] = {
     { PIX_FMT_RGB555, 16 },
     { PIX_FMT_BGR24,  24 },
     { PIX_FMT_RGB32,  32 },
-    { -1, 0 },
+    { PIX_FMT_NONE, 0 },
 };
 
 static const PixelFormatTag pixelFormatBpsMOV[] = {
@@ -51,10 +51,10 @@ static const PixelFormatTag pixelFormatBpsMOV[] = {
     { PIX_FMT_BGR555,   16 },
     { PIX_FMT_RGB24,    24 },
     { PIX_FMT_BGR32_1,  32 },
-    { -1, 0 },
+    { PIX_FMT_NONE, 0 },
 };
 
-static int findPixelFormat(const PixelFormatTag *tags, unsigned int fourcc)
+static enum PixelFormat findPixelFormat(const PixelFormatTag *tags, unsigned int fourcc)
 {
     while (tags->pix_fmt >= 0) {
         if (tags->fourcc == fourcc)