[MPlayer-dev-eng] [PATCH] Remove usage of variable-length stack arrays.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Thu Jan 21 23:57:20 EET 2021


They have a couple of issues like complicating
stack hardening, stack sizes can be very different
and thus failures particularly unpredictable but
also compiler support is not universal.
In particular MSVC does not support it.
As a side benefit, at least some of the
code becomes easier to understand.
---
 command.c               |  8 ++++----
 libmenu/menu.c          |  9 +++------
 libmenu/menu_console.c  | 11 ++++++-----
 libmenu/menu_filesel.c  | 34 +++++++++++++++-------------------
 libmpcodecs/vf.c        |  3 ++-
 libmpdemux/demux_film.c |  6 ++++--
 libmpdemux/demux_mov.c  |  6 ++++--
 libvo/vo_gif89a.c       | 10 ++++++----
 libvo/vo_md5sum.c       |  6 ++++--
 m_config.c              | 17 ++++++++---------
 m_option.c              | 11 +++++------
 m_property.c            | 16 +++++++---------
 mplayer.c               | 16 ++++++++--------
 stream/freesdp/parser.c |  7 ++++---
 14 files changed, 80 insertions(+), 80 deletions(-)

diff --git a/command.c b/command.c
index 3432fe5df..c15a860da 100644
--- a/command.c
+++ b/command.c
@@ -1315,10 +1315,10 @@ static int mp_property_gamma(m_option_t *prop, int action, void *arg,

 #ifdef CONFIG_TV
     if (mpctx->demuxer->type == DEMUXER_TYPE_TV) {
-        int l = strlen(prop->name);
-        char tv_prop[3 + l + 1];
-        sprintf(tv_prop, "tv_%s", prop->name);
-        return mp_property_do(tv_prop, action, arg, mpctx);
+        char *tv_prop = av_asprintf("tv_%s", prop->name);
+        r = mp_property_do(tv_prop, action, arg, mpctx);
+        av_freep(&tv_prop);
+        return r;
     }
 #endif

diff --git a/libmenu/menu.c b/libmenu/menu.c
index 77be2187b..b79367fc4 100644
--- a/libmenu/menu.c
+++ b/libmenu/menu.c
@@ -747,17 +747,14 @@ void menu_draw_box(mp_image_t* mpi,unsigned char grey,unsigned char alpha, int x

   {
     int stride = (w+15)&(~15); // round to 16
-#if HAVE_LOCAL_ALIGNED
-    DECLARE_ALIGNED(16, char, pic)[stride];
-    DECLARE_ALIGNED(16, char, pic_alpha)[stride];
-#else
-    char pic[stride],pic_alpha[stride];
-#endif
+    char *pic = av_malloc(2*stride);
+    char *pic_alpha = pic + stride;
     memset(pic,g,stride);
     memset(pic_alpha,alpha,stride);
     draw_alpha(w,h,pic,pic_alpha,0,
                mpi->planes[0] + y * mpi->stride[0] + x * (mpi->bpp>>3),
                mpi->stride[0]);
+    av_freep(&pic);
   }

 }
diff --git a/libmenu/menu_console.c b/libmenu/menu_console.c
index 356b39c8d..8bbc42ad6 100644
--- a/libmenu/menu_console.c
+++ b/libmenu/menu_console.c
@@ -32,6 +32,8 @@
 #include <unistd.h>
 #include <errno.h>

+#include "libavutil/mem.h"
+#include "libavutil/avstring.h"
 #include "libmpcodecs/img_format.h"
 #include "libmpcodecs/mp_image.h"

@@ -217,12 +219,12 @@ static void draw(menu_t* menu, mp_image_t* mpi) {
     menu_draw_box(mpi,mpriv->bg,mpriv->bg_alpha,0,0,mpi->w,h);

   if(!mpriv->child || !mpriv->raw_child){
-    char input[strlen(mpriv->cur_history->buffer) + strlen(mpriv->prompt) + 1];
-    sprintf(input,"%s%s",mpriv->prompt,mpriv->cur_history->buffer);
+    char *input = av_asprintf("%s%s",mpriv->prompt,mpriv->cur_history->buffer);
     menu_text_size(input,w,mpriv->vspace,1,&lw,&lh);
     menu_draw_text_full(mpi,input,x,y,w,h,mpriv->vspace,1,
 			MENU_TEXT_BOT|MENU_TEXT_LEFT,
 			MENU_TEXT_BOT|MENU_TEXT_LEFT);
+    av_freep(&input);
     y -= lh + mpriv->vspace;
   }

@@ -342,10 +344,9 @@ static int run_shell_cmd(menu_t* menu, char* cmd) {

 static void enter_cmd(menu_t* menu) {
   history_t* h;
-  char input[strlen(mpriv->cur_history->buffer) + strlen(mpriv->prompt) + 1];
-
-  sprintf(input,"%s%s",mpriv->prompt,mpriv->cur_history->buffer);
+  char *input = av_asprintf("%s%s",mpriv->prompt,mpriv->cur_history->buffer);
   add_line(mpriv,input);
+  av_freep(&input);

   if(mpriv->history == mpriv->cur_history) {
     if(mpriv->history_size >= mpriv->history_max) {
diff --git a/libmenu/menu_filesel.c b/libmenu/menu_filesel.c
index 45795ec79..33091700d 100644
--- a/libmenu/menu_filesel.c
+++ b/libmenu/menu_filesel.c
@@ -142,12 +142,13 @@ static char* replace_path(char* title , char* dir , int escape) {
 }

 static int mylstat(char *dir, char *file,struct stat* st) {
-  int l = strlen(dir) + strlen(file);
-  char s[l+2];
+  int res;
+  char *s = av_asprintf("%s/%s",dir,file);
+  int l = strlen(s);
   if (!strcmp("..", file)) {
     char *slash;
     l -= 3;
-    strcpy(s, dir);
+    s[l+1] = 0;
 #if HAVE_DOS_PATHS
     if (s[l] == '/' || s[l] == '\\')
 #else
@@ -159,13 +160,12 @@ static int mylstat(char *dir, char *file,struct stat* st) {
     if (!slash)
       slash = strrchr(s,'\\');
 #endif
-    if (!slash)
-      return stat(dir,st);
-    slash[1] = '\0';
-    return stat(s,st);
+    if (slash)
+      slash[1] = '\0';
   }
-  sprintf(s,"%s/%s",dir,file);
-  return stat(s,st);
+  res = stat(s,st);
+  av_freep(&s);
+  return res;
 }

 static int compare(const void *av, const void *bv){
@@ -373,26 +373,22 @@ static void read_cmd(menu_t* menu,int cmd) {
 	}
 	free(p);
     } else { // File and directory dealt with action string.
-      int fname_len = strlen(mpriv->dir) + strlen(mpriv->p.current->p.txt) + 1;
-      char filename[fname_len];
-      char *str;
       char *action = mpriv->p.current->d ? mpriv->dir_action:mpriv->file_action;
-      sprintf(filename,"%s%s",mpriv->dir,mpriv->p.current->p.txt);
-      str = replace_path(action, filename,1);
+      char *filename = av_asprintf("%s%s",mpriv->dir,mpriv->p.current->p.txt);
+      char *str = replace_path(action, filename,1);
       mp_input_parse_and_queue_cmds(str);
       if (str != action)
 	free(str);
+      av_freep(&filename);
     }
   } break;
   case MENU_CMD_ACTION: {
-    int fname_len = strlen(mpriv->dir) + strlen(mpriv->p.current->p.txt) + 1;
-    char filename[fname_len];
-    char *str;
-    sprintf(filename,"%s%s",mpriv->dir,mpriv->p.current->p.txt);
-    str = replace_path(action, filename,1);
+    char *filename = av_asprintf("%s%s",mpriv->dir,mpriv->p.current->p.txt);
+    char *str = replace_path(action, filename,1);
     mp_input_parse_and_queue_cmds(str);
     if(str != action)
       free(str);
+    av_freep(&filename);
   } break;
   default:
     menu_list_read_cmd(menu,cmd);
diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c
index 9e8f0c69f..563632cb9 100644
--- a/libmpcodecs/vf.c
+++ b/libmpcodecs/vf.c
@@ -513,12 +513,13 @@ vf_instance_t* vf_open_filter(vf_instance_t* next, const char *name, char **args
       l += 1 + strlen(args[2*i]) + 1 + strlen(args[2*i+1]);
     l += strlen(name);
     {
-      char str[l+1];
+      char *str = malloc(l+1);
       char* p = str;
       p += sprintf(str,"%s",name);
       for(i = 0 ; args && args[2*i] ; i++)
         p += sprintf(p," %s=%s",args[2*i],args[2*i+1]);
       mp_msg(MSGT_VFILTER,MSGL_INFO,MSGTR_OpeningVideoFilter "[%s]\n",str);
+      free(str);
     }
   } else if(strcmp(name,"vo")) {
     if(args && strcmp(args[0],"_oldargs_") == 0)
diff --git a/libmpdemux/demux_film.c b/libmpdemux/demux_film.c
index 5f756fc4b..fdb391ddd 100644
--- a/libmpdemux/demux_film.c
+++ b/libmpdemux/demux_film.c
@@ -148,21 +148,23 @@ static int demux_film_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds)
     if (sh_audio->wf->nChannels == 2) {
       if (sh_audio->wf->wBitsPerSample == 8) {
         unsigned char* tmp = dp->buffer;
-        unsigned char  buf[film_chunk.chunk_size];
+        unsigned char* buf = malloc(film_chunk.chunk_size);
         for(i = 0; i < film_chunk.chunk_size/2; i++) {
           buf[i*2] = tmp[i];
           buf[i*2+1] = tmp[film_chunk.chunk_size/2+i];
         }
         memcpy( tmp, buf, film_chunk.chunk_size );
+        free(buf);
       }
       else {/* for 16bit */
         unsigned short* tmp = dp->buffer;
-        unsigned short  buf[film_chunk.chunk_size/2];
+        unsigned short* buf = malloc(film_chunk.chunk_size);
         for(i = 0; i < film_chunk.chunk_size/4; i++) {
           buf[i*2] = tmp[i];
           buf[i*2+1] = tmp[film_chunk.chunk_size/4+i];
         }
         memcpy( tmp, buf, film_chunk.chunk_size );
+        free(buf);
       }
     }

diff --git a/libmpdemux/demux_mov.c b/libmpdemux/demux_mov.c
index 8c605e0a2..822f0399a 100644
--- a/libmpdemux/demux_mov.c
+++ b/libmpdemux/demux_mov.c
@@ -1527,8 +1527,9 @@ static void lschunks(demuxer_t* demuxer,int level,off_t endpos,mov_track_t* trak
 		    case MOV_FOURCC(0xa9,'s','w','r'):
 		    {
 			off_t text_len = stream_read_word(demuxer->stream);
-			char text[text_len+2+1];
-			stream_read(demuxer->stream, (char *)&text, text_len+2);
+			if (text_len >> 16) { udta_size = 0; break; } // eof
+			char *text = malloc(text_len+2+1);
+			stream_read(demuxer->stream, text, text_len+2);
 			text[text_len+2] = 0x0;
 			switch(udta_id)
 			{
@@ -1581,6 +1582,7 @@ static void lschunks(demuxer_t* demuxer,int level,off_t endpos,mov_track_t* trak
 				mp_msg(MSGT_DEMUX, MSGL_V, " Source providers: %s\n", &text[2]);
 				break;
 			}
+			free(text);
 			udta_size -= 4+text_len;
 			break;
 		    }
diff --git a/libvo/vo_gif89a.c b/libvo/vo_gif89a.c
index e8e024f53..0742d99a5 100644
--- a/libvo/vo_gif89a.c
+++ b/libvo/vo_gif89a.c
@@ -268,9 +268,9 @@ static void check_events(void) {}

 static int gif_reduce(int width, int height, uint8_t *src, uint8_t *dst, GifColorType *colors)
 {
-	unsigned char Ra[width * height];
-	unsigned char Ga[width * height];
-	unsigned char Ba[width * height];
+	unsigned char *Ra = malloc(3*width * height);
+	unsigned char *Ga = Ra + width * height;
+	unsigned char *Ba = Ga + width * height;
 	unsigned char *R, *G, *B;
 	int size = 256;
 	int i;
@@ -284,7 +284,9 @@ static int gif_reduce(int width, int height, uint8_t *src, uint8_t *dst, GifColo
 	}

 	R = Ra; G = Ga; B = Ba;
-	return QuantizeBuffer(width, height, &size, R, G, B, dst, colors);
+	i = QuantizeBuffer(width, height, &size, R, G, B, dst, colors);
+	free(Ra);
+	return i;
 }

 static void flip_page(void)
diff --git a/libvo/vo_md5sum.c b/libvo/vo_md5sum.c
index 2df3b2561..3b2b4049c 100644
--- a/libvo/vo_md5sum.c
+++ b/libvo/vo_md5sum.c
@@ -66,6 +66,7 @@ const LIBVO_EXTERN (md5sum)

 char *md5sum_outfile = NULL;

+struct AVMD5 *md5_context;
 FILE *md5sum_fd;
 int framenum = 0;

@@ -153,6 +154,8 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
         exit_player(EXIT_ERROR);
     }

+    md5_context = av_md5_alloc();
+
     return 0;
 }

@@ -195,8 +198,6 @@ static uint32_t draw_image(mp_image_t *mpi)
     uint32_t strideU = mpi->stride[1];
     uint32_t strideV = mpi->stride[2];

-    uint8_t md5_context_memory[av_md5_size];
-    struct AVMD5 *md5_context = (struct AVMD5*) md5_context_memory;
     unsigned int i;

     if (mpi->flags & MP_IMGFLAG_PLANAR) { /* Planar */
@@ -266,6 +267,7 @@ static void uninit(void)
     free(md5sum_outfile);
     md5sum_outfile = NULL;
     if (md5sum_fd && md5sum_fd != stdout) fclose(md5sum_fd);
+    av_freep(&md5_context);
 }

 /* ------------------------------------------------------------------------- */
diff --git a/m_config.c b/m_config.c
index ccdab1272..0b8c04b24 100644
--- a/m_config.c
+++ b/m_config.c
@@ -29,6 +29,7 @@
 #include <assert.h>
 #endif

+#include "libavutil/common.h"
 #include "libavutil/avstring.h"
 #include "m_config.h"
 #include "m_option.h"
@@ -110,10 +111,9 @@ static int show_profile(m_option_t *opt, char* name, char *param)
                p->desc ? p->desc : "");
     config->profile_depth++;
     for (i = 0; i < p->num_opts; i++) {
-        char spc[config->profile_depth + 1];
-        for (j = 0; j < config->profile_depth; j++)
-            spc[j] = ' ';
-        spc[config->profile_depth] = '\0';
+        char spc[MAX_PROFILE_DEPTH + 1];
+        memset(spc, ' ', MAX_PROFILE_DEPTH);
+        spc[FFMIN(config->profile_depth, MAX_PROFILE_DEPTH)] = '\0';

         mp_msg(MSGT_CFGPARSER, MSGL_INFO, "%s%s=%s\n", spc,
                p->opts[2 * i], p->opts[2 * i + 1]);
@@ -123,12 +123,11 @@ static int show_profile(m_option_t *opt, char* name, char *param)
             char *e, *list = p->opts[2 * i + 1];
             while ((e = strchr(list, ','))) {
                 int l = e-list;
-                char tmp[l+1];
                 if (!l)
                     continue;
-                memcpy(tmp, list, l);
-                tmp[l] = '\0';
+                char *tmp = av_strndup(list, l);
                 show_profile(opt, name, tmp);
+                av_freep(&tmp);
                 list = e+1;
             }
             if (list[0] != '\0')
@@ -449,9 +448,9 @@ m_config_parse_option(const m_config_t *config, char *arg, char *param, int set)
       int l = strlen(co->name) + 1 + strlen(lst[2*i]) + 1;
       if(r >= 0) {
 	// Build the full name
-	char n[l];
-	sprintf(n,"%s:%s",co->name,lst[2*i]);
+	char *n = av_asprintf("%s:%s",co->name,lst[2*i]);
 	sr = m_config_parse_option(config,n,lst[2*i+1],set);
+        av_freep(&n);
 	if(sr < 0){
 	  if(sr == M_OPT_UNKNOWN){
 	    mp_msg(MSGT_CFGPARSER, MSGL_ERR,MSGTR_InvalidSuboption,co->name,lst[2*i]);
diff --git a/m_option.c b/m_option.c
index 268055a78..e1fdba4c9 100644
--- a/m_option.c
+++ b/m_option.c
@@ -36,6 +36,7 @@
 #include "stream/url.h"
 #include "libavutil/avstring.h"
 #include "libavutil/attributes.h"
+#include "libavutil/mem.h"

 // Don't free for 'production' atm
 #ifndef MP_DEBUG
@@ -1813,9 +1814,7 @@ static int parse_obj_settings_list(const m_option_t* opt,const char *name,
     else if(av_strcasecmp(n,"-clr") == 0)
       op = OP_CLR;
     else {
-      char prefix[len];
-      strncpy(prefix,opt->name,len-1);
-      prefix[len-1] = '\0';
+      char *prefix = av_strndup(opt->name, len-1);
       mp_msg(MSGT_VFILTER,MSGL_ERR, "Option %s: unknown postfix %s\n"
 	     "Supported postfixes are:\n"
 	     "  %s-add\n"
@@ -1827,6 +1826,7 @@ static int parse_obj_settings_list(const m_option_t* opt,const char *name,
 	     " Negative index can be used (i.e. -1 is the last element)\n\n"
 	     "  %s-clr\n"
 	     " Clear the current list.\n",name,n,prefix,prefix,prefix,prefix);
+      av_freep(&prefix);

       return M_OPT_UNKNOWN;
     }
@@ -2196,10 +2196,9 @@ static int parse_custom_url(const m_option_t* opt,const char *name,
       mp_msg(MSGT_CFGPARSER, MSGL_WARN, "Option %s: This URL doesn't have a hostname part.\n",name);
       // skip
     } else {
-      char tmp[pos2-pos1+1];
-      strncpy(tmp,ptr1, pos2-pos1);
-      tmp[pos2-pos1] = '\0';
+      char *tmp = av_strndup(ptr1, pos2-pos1);
       r = m_struct_set(desc,dst,"hostname",tmp);
+      av_freep(&tmp);
       if(r < 0) {
 	mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Option %s: Error while setting hostname.\n",name);
 	return r;
diff --git a/m_property.c b/m_property.c
index 0727795b1..3a75f69ce 100644
--- a/m_property.c
+++ b/m_property.c
@@ -27,6 +27,7 @@
 #include <inttypes.h>
 #include <unistd.h>

+#include "libavutil/mem.h"
 #include "m_option.h"
 #include "m_property.h"
 #include "mp_msg.h"
@@ -41,10 +42,9 @@ static int do_action(const m_option_t* prop_list, const char* name,
     int r;
     if((sep = strchr(name,'/')) && sep[1]) {
         int len = sep-name;
-        char base[len+1];
-        memcpy(base,name,len);
-        base[len] = 0;
+        char *base = av_strndup(name, len);
         prop = m_option_list_find(prop_list, base);
+        av_freep(&base);
         ka.key = sep+1;
         ka.action = action;
         ka.arg = arg;
@@ -150,29 +150,27 @@ char* m_properties_expand_string(const m_option_t* prop_list,char* str, void *ct
             lvl--, str++, l = 0;
         } else if(str[0] == '$' && str[1] == '{' && (e = strchr(str+2,'}'))) {
             int pl = e-str-2;
-            char pname[pl+1];
-            memcpy(pname,str+2,pl);
-            pname[pl] = 0;
+            char *pname = av_strndup(str+2, pl);
             if(m_property_do(prop_list, pname,
                              M_PROPERTY_PRINT, &p, ctx) >= 0 && p)
                 l = strlen(p), fr = 1;
             else
                 l = 0;
+            av_freep(&pname);
             str = e+1;
         } else if(str[0] == '?' && str[1] == '(' && (e = strchr(str+2,':'))) {
             lvl++;
             if(!skip) {
                 int is_not = str[2] == '!';
                 int pl = e - str - (is_not ? 3 : 2);
-                char pname[pl+1];
-                memcpy(pname, str + (is_not ? 3 : 2), pl);
-                pname[pl] = 0;
+                char *pname = av_strndup(str + (is_not ? 3 : 2), pl);
                 if(m_property_do(prop_list,pname,M_PROPERTY_GET,NULL,ctx) < 0) {
                     if (!is_not)
                         skip = 1, skip_lvl = lvl;
                 }
                 else if (is_not)
                     skip = 1, skip_lvl = lvl;
+                av_freep(&pname);
             }
             str = e+1, l = 0;
         } else
diff --git a/mplayer.c b/mplayer.c
index 3ab0f2d10..92d65384f 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -890,7 +890,7 @@ static void parse_cfgfiles(m_config_t *conf)
 static void load_per_protocol_config(m_config_t *conf, const char *const file)
 {
     char *str;
-    char protocol[strlen(PROFILE_CFG_PROTOCOL) + strlen(file) + 1];
+    char *protocol;
     m_profile_t *p;

     /* does filename actually uses a protocol ? */
@@ -898,13 +898,14 @@ static void load_per_protocol_config(m_config_t *conf, const char *const file)
     if (!str)
         return;

-    sprintf(protocol, "%s%s", PROFILE_CFG_PROTOCOL, file);
-    protocol[strlen(PROFILE_CFG_PROTOCOL) + strlen(file) - strlen(str)] = '\0';
+    protocol = av_asprintf("%s%s", PROFILE_CFG_PROTOCOL, file);
+    *strstr(protocol, "://") = 0;
     p = m_config_get_profile(conf, protocol);
     if (p) {
         mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_LoadingProtocolProfile, protocol);
         m_config_set_profile(conf, p);
     }
+    av_freep(&protocol);
 }

 #define PROFILE_CFG_EXTENSION "extension."
@@ -912,7 +913,7 @@ static void load_per_protocol_config(m_config_t *conf, const char *const file)
 static void load_per_extension_config(m_config_t *conf, const char *const file)
 {
     char *str;
-    char extension[strlen(PROFILE_CFG_EXTENSION) + 8];
+    char extension[sizeof(PROFILE_CFG_EXTENSION) + 7];
     m_profile_t *p;

     /* does filename actually have an extension ? */
@@ -920,8 +921,7 @@ static void load_per_extension_config(m_config_t *conf, const char *const file)
     if (!str)
         return;

-    sprintf(extension, PROFILE_CFG_EXTENSION);
-    strncat(extension, ++str, 7);
+    snprintf(extension, sizeof(extension), "%s%s", PROFILE_CFG_EXTENSION, ++str);
     p = m_config_get_profile(conf, extension);
     if (p) {
         mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_LoadingExtensionProfile, extension);
@@ -934,15 +934,15 @@ static void load_per_extension_config(m_config_t *conf, const char *const file)

 static void load_per_output_config(m_config_t *conf, char *cfg, char *out)
 {
-    char profile[strlen(cfg) + strlen(out) + 1];
     m_profile_t *p;

-    sprintf(profile, "%s%s", cfg, out);
+    char *profile = av_asprintf("%s%s", cfg, out);
     p = m_config_get_profile(conf, profile);
     if (p) {
         mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_LoadingExtensionProfile, profile);
         m_config_set_profile(conf, p);
     }
+    av_freep(&profile);
 }

 /**
diff --git a/stream/freesdp/parser.c b/stream/freesdp/parser.c
index d770bda96..6417c4461 100644
--- a/stream/freesdp/parser.c
+++ b/stream/freesdp/parser.c
@@ -67,10 +67,10 @@ fsdp_parse (const char *text_description, fsdp_description_t * dsc)
   const char *p = text_description, *p2;
   unsigned int j;
   /* temps for sscanf */
-  const unsigned int TEMPCHARS = 6;
+#define TEMPCHARS 6
   char fsdp_buf[TEMPCHARS][MAXSHORTFIELDLEN];
   char longfsdp_buf[MAXLONGFIELDLEN];
-  const unsigned int TEMPINTS = 2;
+#define TEMPINTS 2
   unsigned long int wuint[TEMPINTS];

   if ((NULL == text_description) || (NULL == dsc))
@@ -912,7 +912,8 @@ fsdp_parse_c (const char **p, fsdp_network_type_t * ntype,
 	      fsdp_address_type_t * atype,
 	      fsdp_connection_address_t * address)
 {
-  const unsigned int TEMPCHARS = 3;
+#undef TEMPCHARS
+#define TEMPCHARS 3
   char fsdp_buf[TEMPCHARS][MAXSHORTFIELDLEN];

   if (!strncmp (*p, "c=", 2))
--
2.30.0



More information about the MPlayer-dev-eng mailing list