[MPlayer-cvslog] r32973 - trunk/mplayer.c

Reinhard Tartler siretart at tauware.de
Sun Feb 27 08:10:06 CET 2011


On Sat, Feb 26, 2011 at 12:58:53 (CET), cboesch wrote:

> Author: cboesch
> Date: Sat Feb 26 12:58:53 2011
> New Revision: 32973
>
> Log:
> Use mp_asprintf in get_metadata instead of limited stack buffer.
>
> Modified:
>    trunk/mplayer.c
>
> Modified: trunk/mplayer.c
> ==============================================================================
> --- trunk/mplayer.c	Sat Feb 26 12:57:54 2011	(r32972)
> +++ trunk/mplayer.c	Sat Feb 26 12:58:53 2011	(r32973)
> @@ -438,7 +438,6 @@ static char *get_demuxer_info (char *tag
>  }
>  
>  char *get_metadata (metadata_t type) {
> -  char meta[128];
>    sh_audio_t * const sh_audio = mpctx->sh_audio;
>    sh_video_t * const sh_video = mpctx->sh_video;
>  
> @@ -460,18 +459,14 @@ char *get_metadata (metadata_t type) {
>      else if (sh_video->format == 0x10000005)
>        return strdup("h264");
>      else if (sh_video->format >= 0x20202020)
> -      snprintf(meta, sizeof(meta), "%.4s", (char *) &sh_video->format);
> -    else
> -      snprintf(meta, sizeof(meta), "0x%08X", sh_video->format);
> -    return strdup(meta);
> +      return mp_asprintf("%.4s", (char *)&sh_video->format);
> +    return mp_asprintf("0x%08X", sh_video->format);
>  
>    case META_VIDEO_BITRATE:
> -    snprintf(meta, sizeof(meta), "%d kbps", (int) (sh_video->i_bps * 8 / 1024));
> -    return strdup(meta);
> +    return mp_asprintf("%d kbps", (int)(sh_video->i_bps * 8 / 1024));
>  
>    case META_VIDEO_RESOLUTION:
> -    snprintf(meta, sizeof(meta), "%d x %d", sh_video->disp_w, sh_video->disp_h);
> -    return strdup(meta);
> +    return mp_asprintf("%d x %d", sh_video->disp_w, sh_video->disp_h);
>  
>    case META_AUDIO_CODEC:
>      if (sh_audio->codec && sh_audio->codec->name)
> @@ -479,12 +474,10 @@ char *get_metadata (metadata_t type) {
>      break;
>  
>    case META_AUDIO_BITRATE:
> -    snprintf(meta, sizeof(meta), "%d kbps", (int)(sh_audio->i_bps * 8 / 1000));
> -    return strdup(meta);
> +    return mp_asprintf("%d kbps", (int)(sh_audio->i_bps * 8 / 1000));
>  
>    case META_AUDIO_SAMPLES:
> -    snprintf(meta, sizeof(meta), "%d Hz, %d ch.", sh_audio->samplerate, sh_audio->channels);
> -    return strdup(meta);
> +    return mp_asprintf("%d Hz, %d ch.", sh_audio->samplerate, sh_audio->channels);
>  
>    /* check for valid demuxer */
>    case META_INFO_TITLE:

This commit breaks the daily mplayer builds on amd64:

Function `mp_asprintf' implicitly converted to pointer at mplayer.c:462
Function `mp_asprintf' implicitly converted to pointer at mplayer.c:462
Function `mp_asprintf' implicitly converted to pointer at mplayer.c:462
Function `mp_asprintf' implicitly converted to pointer at mplayer.c:462



Our automated build log filter detected the problem(s) above that will
likely cause your package to segfault on architectures where the size of
a pointer is greater than the size of an integer, such as ia64 and amd64.

This is often due to a missing function prototype definition.

Since use of implicitly converted pointers is always fatal to the application
on ia64, they are errors.  Please correct them for your next upload.

More information can be found at:
    http://wiki.debian.org/ImplicitPointerConversions


Full buildlog here:
http://launchpadlibrarian.net/65218896/buildlog_ubuntu-maverick-amd64.mplayer_2:1.0~svn32975~maverick_FAILEDTOBUILD.txt.gz

-- 
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4



More information about the MPlayer-cvslog mailing list