diff --git a/libavcodec/raw.c b/libavcodec/raw.c
index c0cc56dd80e0721b69b3c0177e9adb9ba441db13..1f60477aef32457522b18f083776c9f5dbb39cef 100644
--- a/libavcodec/raw.c
+++ b/libavcodec/raw.c
@@ -48,6 +48,7 @@ const PixelFormatTag ff_raw_pixelFormatTags[] = {
     { PIX_FMT_BGR555,  MKTAG('B', 'G', 'R', 15) },
     { PIX_FMT_RGB565,  MKTAG('R', 'G', 'B', 16) },
     { PIX_FMT_BGR565,  MKTAG('B', 'G', 'R', 16) },
+    { PIX_FMT_RGB565,  MKTAG( 3 ,  0 ,  0 ,  0 ) },
 
     /* quicktime */
     { PIX_FMT_UYVY422, MKTAG('2', 'v', 'u', 'y') },
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index 89e9ea936b33c3c4361a1c3f6f650516cb845555..2f29271c9a0ae8f9df6ee4b42edc2aa51ad04586 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -87,7 +87,8 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
     if (!context->buffer)
         return -1;
 
-    if(avctx->extradata_size >= 9 && !memcmp(avctx->extradata + avctx->extradata_size - 9, "BottomUp", 9))
+    if((avctx->extradata_size >= 9 && !memcmp(avctx->extradata + avctx->extradata_size - 9, "BottomUp", 9)) ||
+       avctx->codec_tag == MKTAG( 3 ,  0 ,  0 ,  0 ))
         context->flip=1;
 
     return 0;
diff --git a/libavformat/riff.c b/libavformat/riff.c
index 5b8c272f93bc04bc9295c2823575e7a351822069..a2791213693d094ef11fad1a8ad28fdd540b29b0 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -133,6 +133,7 @@ const AVCodecTag codec_bmp_tags[] = {
     { CODEC_ID_FFVHUFF,      MKTAG('F', 'F', 'V', 'H') },
     { CODEC_ID_CYUV,         MKTAG('C', 'Y', 'U', 'V') },
     { CODEC_ID_RAWVIDEO,     MKTAG( 0 ,  0 ,  0 ,  0 ) },
+    { CODEC_ID_RAWVIDEO,     MKTAG( 3 ,  0 ,  0 ,  0 ) },
     { CODEC_ID_RAWVIDEO,     MKTAG('I', '4', '2', '0') },
     { CODEC_ID_RAWVIDEO,     MKTAG('Y', 'U', 'Y', '2') },
     { CODEC_ID_RAWVIDEO,     MKTAG('Y', '4', '2', '2') },