-
Notifications
You must be signed in to change notification settings - Fork 165
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
Conversation
82a6dd4
to
5603377
Compare
videoprocess/vpphdr_tm.cpp
Outdated
@@ -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 {// |
There was a problem hiding this comment.
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?
videoprocess/vpphdr_tm.cpp
Outdated
@@ -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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Signed-off-by: Alex1 Zhang [email protected]
5603377
to
35edf99
Compare
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Signed-off-by: Alex1 Zhang [email protected]