]> code.delx.au - refind/blobdiff - libeg/image.c
Cleanup for better tracking of copyrights and licenses.
[refind] / libeg / image.c
index 0322d12a3ae04d53c04e407a3b0ee8f1fbc8b336..124c997b454b47a0a1ae63e6266de1f344f49239 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 /*
- * Modifications copyright (c) 2012-2014 Roderick W. Smith
- * 
+ * Modifications copyright (c) 2012-2015 Roderick W. Smith
+ *
  * Modifications distributed under the terms of the GNU General Public
- * License (GPL) version 3 (GPLv3), a copy of which must be distributed
- * with this source code or binaries made from it.
- * 
+ * License (GPL) version 3 (GPLv3), or (at your option) any later version.
+ *
+ */
+/*
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "libegint.h"
@@ -199,7 +212,7 @@ VOID egFreeImage(IN EG_IMAGE *Image)
 // Basic file operations
 //
 
-EFI_STATUS egLoadFile(IN EFI_FILEBaseDir, IN CHAR16 *FileName, OUT UINT8 **FileData, OUT UINTN *FileDataLength)
+EFI_STATUS egLoadFile(IN EFI_FILE *BaseDir, IN CHAR16 *FileName, OUT UINT8 **FileData, OUT UINTN *FileDataLength)
 {
     EFI_STATUS          Status;
     EFI_FILE_HANDLE     FileHandle;
@@ -208,6 +221,9 @@ EFI_STATUS egLoadFile(IN EFI_FILE* BaseDir, IN CHAR16 *FileName, OUT UINT8 **Fil
     UINTN               BufferSize;
     UINT8               *Buffer;
 
+    if ((BaseDir == NULL) || (FileName == NULL))
+       return EFI_NOT_FOUND;
+
     Status = refit_call5_wrapper(BaseDir->Open, BaseDir, &FileHandle, FileName, EFI_FILE_MODE_READ, 0);
     if (EFI_ERROR(Status)) {
         return Status;
@@ -617,27 +633,6 @@ VOID egComposeImage(IN OUT EG_IMAGE *CompImage, IN EG_IMAGE *TopImage, IN UINTN
     }
 } /* VOID egComposeImage() */
 
-// EG_IMAGE * egEnsureImageSize(IN EG_IMAGE *Image, IN UINTN Width, IN UINTN Height, IN EG_PIXEL *Color)
-// {
-//     EG_IMAGE *NewImage;
-// 
-//     if (Image == NULL)
-//         return NULL;
-//     if (Image->Width == Width && Image->Height == Height)
-//         return Image;
-// 
-//     NewImage = egCreateFilledImage(Width, Height, Image->HasAlpha, Color);
-//     if (NewImage == NULL) {
-//         egFreeImage(Image);
-//         return NULL;
-//     }
-//     Image->HasAlpha = FALSE;
-//     egComposeImage(NewImage, Image, 0, 0);
-//     egFreeImage(Image);
-// 
-//     return NewImage;
-// }
-
 //
 // misc internal functions
 //