comparison imgconvert.c @ 6911:0e2576b1e753 libavcodec

Do not read from prior the array, fix CID 127.
author michael
date Tue, 27 May 2008 19:44:56 +0000
parents c93570aeb3eb
children cc2c5a21a0eb
comparison
equal deleted inserted replaced
6910:67c615c7e19c 6911:0e2576b1e753
405 return i; 405 return i;
406 } 406 }
407 407
408 void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt) 408 void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt)
409 { 409 {
410 PixFmtInfo info= pix_fmt_info[pix_fmt];
411
412 char is_alpha_char= info.is_alpha ? 'y' : 'n';
413
414 /* print header */ 410 /* print header */
415 if (pix_fmt < 0) 411 if (pix_fmt < 0)
416 snprintf (buf, buf_size, 412 snprintf (buf, buf_size,
417 "name " " nb_channels" " depth" " is_alpha" 413 "name " " nb_channels" " depth" " is_alpha"
418 ); 414 );
419 else 415 else{
416 PixFmtInfo info= pix_fmt_info[pix_fmt];
417
418 char is_alpha_char= info.is_alpha ? 'y' : 'n';
419
420 snprintf (buf, buf_size, 420 snprintf (buf, buf_size,
421 "%-10s" " %1d " " %2d " " %c ", 421 "%-10s" " %1d " " %2d " " %c ",
422 info.name, 422 info.name,
423 info.nb_channels, 423 info.nb_channels,
424 info.depth, 424 info.depth,
425 is_alpha_char 425 is_alpha_char
426 ); 426 );
427 }
427 } 428 }
428 429
429 int ff_fill_linesize(AVPicture *picture, int pix_fmt, int width) 430 int ff_fill_linesize(AVPicture *picture, int pix_fmt, int width)
430 { 431 {
431 int w2; 432 int w2;