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,7 +350,9 @@ static void print_csp_names( int longhelp ) ...@@ -350,7 +350,9 @@ 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 );
if( pfname )
{
size_t name_len = strlen( pfname ); size_t name_len = strlen( pfname );
if( line_len + name_len > (80 - strlen( ", " )) ) if( line_len + name_len > (80 - strlen( ", " )) )
{ {
...@@ -365,6 +367,7 @@ static void print_csp_names( int longhelp ) ...@@ -365,6 +367,7 @@ static void print_csp_names( int longhelp )
line_len += 2; line_len += 2;
} }
} }
}
#endif #endif
printf( "\n" ); printf( "\n" );
} }
......
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