diff --git a/libavcodec/libopenjpeg.c b/libavcodec/libopenjpeg.c
index f1e047437c547692be857c96c12fb1b3bd506420..387ea8b5d91b06bd19d842f9ac175fbdae4a3e86 100644
--- a/libavcodec/libopenjpeg.c
+++ b/libavcodec/libopenjpeg.c
@@ -131,7 +131,7 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
                  }
                  break;
         case 4:  has_alpha = 1;
-                 avctx->pix_fmt = PIX_FMT_RGB32;
+                 avctx->pix_fmt = PIX_FMT_RGBA;
                  break;
         default: av_log(avctx, AV_LOG_ERROR, "%d components unsupported.\n", image->numcomps);
                  goto done;