Skip to content

Commit

Permalink
Fix some coverity issues exposed in decode
Browse files Browse the repository at this point in the history
Signed-off-by: Pengxin Yuan <[email protected]>
  • Loading branch information
pengxin99 authored and XinfengZhang committed Nov 9, 2023
1 parent 3e28d4e commit 1258c71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions decode/loadjpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ int convert_one_image(const char *infilename)
if (fp == NULL)
exitmessage("Cannot open filename\n");
length_of_file = filesize(fp);
if (length_of_file == -1)
exitmessage("Error to read file\n");
buf = (unsigned char *)malloc(length_of_file + 4);
if (buf == NULL)
exitmessage("Not enough memory for loading file\n");
Expand Down
2 changes: 1 addition & 1 deletion decode/tinyjpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ int tinyjpeg_decode(struct jdec_private *priv)
//surface_type = VA_RT_FORMAT_YUV422H;
surface_type = VA_RT_FORMAT_YUV422;
forcc.value.value.i = VA_FOURCC_422H;
} else if (h2 == 2 && h2 == 2 && h3 == 2 &&
} else if (h1 == 2 && h2 == 2 && h3 == 2 &&
v1 == 2 && v2 == 1 && v3 == 1) {
//surface_type = VA_RT_FORMAT_YUV422V;
surface_type = VA_RT_FORMAT_YUV422;
Expand Down

0 comments on commit 1258c71

Please sign in to comment.