Commit b6ce6c64 authored by Anton Mitrofanov's avatar Anton Mitrofanov Committed by Fiona Glaser
Browse files

Fix crash in --fullhelp when compiled against recent ffmpeg

Don't assume all pixel formats have a description.
parent c3ba63bb
......@@ -350,19 +350,22 @@ static void print_csp_names( int longhelp )
size_t line_len = strlen( INDENT );
for( enum PixelFormat i = PIX_FMT_NONE+1; i < PIX_FMT_NB; i++ )
{
const char *pfname = av_pix_fmt_descriptors[i].name;
size_t name_len = strlen( pfname );
if( line_len + name_len > (80 - strlen( ", " )) )
const char *pfname = av_get_pix_fmt_name( i );
if( pfname )
{
printf( "\n" INDENT );
line_len = strlen( INDENT );
}
printf( "%s", pfname );
line_len += name_len;
if( i+1 < PIX_FMT_NB )
{
printf( ", " );
line_len += 2;
size_t name_len = strlen( pfname );
if( line_len + name_len > (80 - strlen( ", " )) )
{
printf( "\n" INDENT );
line_len = strlen( INDENT );
}
printf( "%s", pfname );
line_len += name_len;
if( i+1 < PIX_FMT_NB )
{
printf( ", " );
line_len += 2;
}
}
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment