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 ) ...@@ -350,19 +350,22 @@ static void print_csp_names( int longhelp )
size_t line_len = strlen( INDENT ); size_t line_len = strlen( INDENT );
for( enum PixelFormat i = PIX_FMT_NONE+1; i < PIX_FMT_NB; i++ ) for( enum PixelFormat i = PIX_FMT_NONE+1; i < PIX_FMT_NB; i++ )
{ {
const char *pfname = av_pix_fmt_descriptors[i].name; const char *pfname = av_get_pix_fmt_name( i );
size_t name_len = strlen( pfname ); if( pfname )
if( line_len + name_len > (80 - strlen( ", " )) )
{ {
printf( "\n" INDENT ); size_t name_len = strlen( pfname );
line_len = strlen( INDENT ); if( line_len + name_len > (80 - strlen( ", " )) )
} {
printf( "%s", pfname ); printf( "\n" INDENT );
line_len += name_len; line_len = strlen( INDENT );
if( i+1 < PIX_FMT_NB ) }
{ printf( "%s", pfname );
printf( ", " ); line_len += name_len;
line_len += 2; if( i+1 < PIX_FMT_NB )
{
printf( ", " );
line_len += 2;
}
} }
} }
#endif #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