summaryrefslogtreecommitdiff
path: root/libavcodec/imgconvert.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-05-27 19:44:56 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-05-27 19:44:56 +0000
commit8e6f8869ab371e676e7c22db986bbd321d34e1c3 (patch)
tree5e5d0e3697bf584bb5670dc53a8f495e0ef0785d /libavcodec/imgconvert.c
parent406a0fdcabc02a7ed003ace033dd18fd36f44a3f (diff)
Do not read from prior the array, fix CID 127.
Originally committed as revision 13471 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/imgconvert.c')
-rw-r--r--libavcodec/imgconvert.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
index 1dcddaa48d..663095435e 100644
--- a/libavcodec/imgconvert.c
+++ b/libavcodec/imgconvert.c
@@ -407,16 +407,16 @@ enum PixelFormat avcodec_get_pix_fmt(const char* name)
void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt)
{
- PixFmtInfo info= pix_fmt_info[pix_fmt];
-
- char is_alpha_char= info.is_alpha ? 'y' : 'n';
-
/* print header */
if (pix_fmt < 0)
snprintf (buf, buf_size,
"name " " nb_channels" " depth" " is_alpha"
);
- else
+ else{
+ PixFmtInfo info= pix_fmt_info[pix_fmt];
+
+ char is_alpha_char= info.is_alpha ? 'y' : 'n';
+
snprintf (buf, buf_size,
"%-10s" " %1d " " %2d " " %c ",
info.name,
@@ -424,6 +424,7 @@ void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt)
info.depth,
is_alpha_char
);
+ }
}
int ff_fill_linesize(AVPicture *picture, int pix_fmt, int width)