diff --git a/modules/codec/avcodec/avcodec.c b/modules/codec/avcodec/avcodec.c
index 0e08c11fc6fcc4c98dd2ac1efc9d9388aeb94af1..912d1b667e27a50c130a167a1d8aba23113367c1 100644
--- a/modules/codec/avcodec/avcodec.c
+++ b/modules/codec/avcodec/avcodec.c
@@ -256,7 +256,8 @@ AVCodecContext *ffmpeg_AllocContext( decoder_t *p_dec,
 
     /* *** determine codec type *** */
     if( !GetFfmpegCodec( p_dec->fmt_in.i_cat, p_dec->fmt_in.i_codec,
-                         &i_codec_id, &psz_namecodec ) )
+                         &i_codec_id, &psz_namecodec ) ||
+         i_codec_id == AV_CODEC_ID_RAWVIDEO )
          return NULL;
 
     msg_Dbg( p_dec, "using %s %s", AVPROVIDER(LIBAVCODEC), LIBAVCODEC_IDENT );