From 055fff5071b4fdfb11886a723f56d51fadfd8c9d Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Fri, 19 Oct 2012 23:14:07 +0000 Subject: Allocate the buffer in loadSource via length of the data and not the file size. This means technically a web URL could be passed to it and it would still work. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@80642 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/plugins/DFXVideo/macsrc/PluginGLView.m | 56 +-------------------------- 1 file changed, 2 insertions(+), 54 deletions(-) (limited to 'macosx/plugins/DFXVideo/macsrc/PluginGLView.m') diff --git a/macosx/plugins/DFXVideo/macsrc/PluginGLView.m b/macosx/plugins/DFXVideo/macsrc/PluginGLView.m index 8f5f4a6b..8f6f3802 100644 --- a/macosx/plugins/DFXVideo/macsrc/PluginGLView.m +++ b/macosx/plugins/DFXVideo/macsrc/PluginGLView.m @@ -838,66 +838,14 @@ void BlitScreen16NS(unsigned char * surf,long x,long y) - (char*)loadSource:(NSURL *)filename { - /*char *src = NULL; - FILE *fp = NULL; - long size; - long i; - - - // Open the file - fp = fopen(filename, "r"); - // Check if its OK - if(fp == NULL) - { - fprintf(stderr, "Impossible to open the file '%s'\n", filename); - return NULL; - } - - // Get the file size - fseek(fp, 0, SEEK_END); - size = ftell(fp); - - // Go back to the beginning - rewind(fp); - - // Allocate memory - src = malloc(size+1); // +1 for '\0' - if(src == NULL) - { - fclose(fp); - fprintf(stderr, "Memory allocation error!\n"); - return NULL; - } - - // The the file - for(i=0; i