[FFmpeg-devel] [PATCH] fix printf length modifier in mpeg12.c

Reimar Döffinger Reimar.Doeffinger
Thu Mar 13 20:09:25 CET 2008


On Thu, Mar 13, 2008 at 08:06:29PM +0100, Reimar D?ffinger wrote:
> On Thu, Mar 13, 2008 at 07:38:02PM +0100, Diego Biurrun wrote:
> > I noticed a warning in mpeg12.c on OS X that hinted at a wrong printf
> > length modifier.  Indeed line 2310 looks suspcious:
> > 
> >   av_log(avctx, AV_LOG_DEBUG, "%3X at %hd left %d\n", start_code, buf_ptr-buf, input_size);
> > 
> > Both buf_ptr and buf have type const uint8_t*, so the correct length
> > modifier should be either 'h' or none.
> 
> Huh? It's a difference of pointers, so z is most likely to be correct, though
> using just %d and casting to int might be more portable and good enough.

Oh, and really correct would be %td , but I fear that might be a gnuism,
PRIdPTR seems like the most portable alternative to me without casting.




More information about the ffmpeg-devel mailing list