[SCM] libquicktime/master: debian/patches/11-path_max.patch

alessio at users.alioth.debian.org alessio at users.alioth.debian.org
Tue Apr 24 22:57:22 UTC 2012


The following commit has been merged in the master branch:
commit ef14f1cf68a0f11a1169d9f552ef40fe5559e720
Author: Alessio Treglia <alessio at debian.org>
Date:   Wed Apr 25 00:56:25 2012 +0200

    debian/patches/11-path_max.patch
    
    - Avoid the use of PATH_MAX to allow building quicktime on hurd.
    
    Closes: #670338
    Thanks: Cyril Roelandt for the patch.

diff --git a/debian/patches/11-path_max.patch b/debian/patches/11-path_max.patch
new file mode 100644
index 0000000..679bc97
--- /dev/null
+++ b/debian/patches/11-path_max.patch
@@ -0,0 +1,85 @@
+Description: Avoid the use of PATH_MAX to allow building quicktime on hurd.
+Author: Cyril Roelandt <tipecaml at gmail.com>
+Bug-Debian: http://bugs.debian.org/670338
+Forwarded: Burkhard Plaum <plaum at ipf.uni-stuttgart.de>
+---
+ src/lqt_codecinfo.c |   13 ++++++++++---
+ utils/rechunk.c     |    9 +++++++--
+ 2 files changed, 17 insertions(+), 5 deletions(-)
+
+--- libquicktime.orig/src/lqt_codecinfo.c
++++ libquicktime/src/lqt_codecinfo.c
+@@ -601,7 +601,8 @@ static int scan_for_plugins(const char *
+   {
+   char * pos;
+   int ret;
+-  char * filename;
++  char * filename = NULL;
++  size_t filename_len = 0, new_size = 0;
+   DIR * directory;
+   struct dirent * directory_entry;
+   struct stat status;
+@@ -611,8 +612,6 @@ static int scan_for_plugins(const char *
+   lqt_codec_info_t * video_codecs_end;
+   lqt_codec_info_t * audio_codecs_end;
+ 
+-  filename = malloc(PATH_MAX * sizeof(char));
+-  
+   /* Set the end pointers so we can quickly add codecs after */
+ 
+   
+@@ -662,6 +661,14 @@ static int scan_for_plugins(const char *
+     
+     /* Now, the file should be a valid plugin, construct the filename */
+     
++    new_size = strlen(plugin_dir) + strlen(directory_entry->d_name) + 2;
++    if (new_size > filename_len)
++      {
++      filename_len = new_size;
++      filename = realloc(filename, filename_len);
++      if (!filename)
++        exit(EXIT_FAILURE);
++      }
+     strcpy(filename, plugin_dir);
+     strcat(filename, "/");
+     strcat(filename, directory_entry->d_name);
+--- libquicktime.orig/utils/rechunk.c
++++ libquicktime/utils/rechunk.c
+@@ -46,7 +46,7 @@ static char ** add_frames_from_file(char
+   {
+   FILE * input;
+   char * pos;
+-  char filename[PATH_MAX+10];
++  char *filename = NULL;
+ 
+   input = fopen(list_filename, "r");
+   if(!input)
+@@ -56,7 +56,7 @@ static char ** add_frames_from_file(char
+     return (char**)0;
+     }
+ 
+-  while(fgets(filename, PATH_MAX+10, input))
++  while(getline(&filename, NULL, input) != -1)
+     {
+     /* Delete trailing '\n' and '\r' */
+ 
+@@ -72,7 +72,10 @@ static char ** add_frames_from_file(char
+         break;
+ 
+       if(pos == filename)
++        {
++        free(filename);
+         return input_frames;
++        }
+       
+       pos--;      
+       }
+@@ -83,6 +86,8 @@ static char ** add_frames_from_file(char
+     input_frames = realloc(input_frames, sizeof(char*) * *total_input_frames);
+     input_frames[*total_input_frames - 1] = strdup(filename);
+     //    fprintf(stderr, "Adding file %s\n", input_frames[*total_input_frames - 1]);
++    free(filename);
++    filename = NULL;
+     }
+   return input_frames;
+   }
diff --git a/debian/patches/series b/debian/patches/series
index 6908b6f..6932187 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 02-install-in-libquicktime2.patch
+11-path_max.patch

-- 
libquicktime packaging



More information about the pkg-multimedia-commits mailing list