Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix VPP coverity issues #350

Merged
merged 1 commit into from
Nov 9, 2023
Merged

Conversation

Alex1Zhang
Copy link
Contributor

@Alex1Zhang Alex1Zhang commented Nov 9, 2023

Signed-off-by: Alex1 Zhang [email protected]

@@ -588,7 +590,9 @@ bool read_frame_to_surface(FILE *fp, VASurfaceID surface_id)
frame_size = va_image.width * va_image.height * 4;
src_buffer = (unsigned char*)malloc(frame_size);
assert(src_buffer);
fread(src_buffer, 1, frame_size, fp);
do {//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deadloop if the file is corrupted?

@@ -560,7 +560,9 @@ bool read_frame_to_surface(FILE *fp, VASurfaceID surface_id)

src_buffer = (unsigned char*)malloc(frame_size);
assert(src_buffer);
fread(src_buffer, 1, frame_size, fp);
do{
n_items = fread(src_buffer, 1, frame_size, fp);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what will happen if the src file is corrupted. and full size < frame_size?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add log to check the return value instead of read in loop.

Copy link
Contributor

@FurongZhang FurongZhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@@ -1236,10 +1236,6 @@ video_frame_process_scaling(VASurfaceID in_surface_id,
vaDestroyBuffer(va_dpy, pipeline_param_buf_id);
}

if (filter_param_buf_id != VA_INVALID_ID) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where to destroy filter_param_buf_id?

Copy link
Contributor Author

@Alex1Zhang Alex1Zhang Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trigger the deadcode error, this code always not be entered, so remove it.

@XinfengZhang XinfengZhang merged commit b0389f4 into intel:master Nov 9, 2023
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants