[FFmpeg-devel] [PATCH] work around some 'may be used uninitialized warnings'
Aurelien Jacobs
aurel
Wed Mar 4 22:48:39 CET 2009
Diego Biurrun wrote:
> Here is a patch to work around the 'may be used uninitialized warnings'
> in libavformat, please review. I will commit individual parts if OKed,
> not before.
>
> A bunch of these warnings seem to be legitimate. I initialized these
> variables to 0, but probably somebody should have a closer look at the
> code.
>
> [...]
>
> Index: libavformat/matroskadec.c
> ===================================================================
> --- libavformat/matroskadec.c (revision 17759)
> +++ libavformat/matroskadec.c (working copy)
> @@ -947,7 +947,7 @@
> static void matroska_fix_ass_packet(MatroskaDemuxContext *matroska,
> AVPacket *pkt, uint64_t display_duration)
> {
> - char *line, *layer, *ptr = pkt->data, *end = ptr+pkt->size;
> + char *line, *av_uninit(layer), *ptr = pkt->data, *end = ptr+pkt->size;
> for (; *ptr!=',' && ptr<end-1; ptr++);
> if (*ptr == ',')
> layer = ++ptr;
I have no warning at all here regarding this file (gcc-4.3.3).
Do you use an old gcc version or something like that, to get this warning?
Aurel
More information about the ffmpeg-devel
mailing list