Repository navigation
[Media_Common][Coverity] Fix NULL_FIELD dereferences in va_trace and va_dri2 - #898
Merged
XinfengZhang merged 1 commit intoOct 23, 2026
Conversation
…va_dri2 Fix two Coverity NULL_FIELD defects (CID 3528231, CID 3660939): 1. va/va_trace.c (CID 3528231): In va_TraceVPrint(), fp_log is read from trace_ctx->plog_file->fp_log and passed directly to vfprintf/fflush without a null check. Since fp_log is set from fopen() output (which can return NULL on failure), dereferencing it unconditionally causes undefined behavior. All other sites in the file that use fp_log check it for null first (lines 744, 920, 2113, 4307). Add the missing null guard before the FILE* use. 2. va/x11/va_dri2.c (CID 3660939): VA_DRI2GetBuffers_internal() dereferences info->codes->major_opcode without checking info->codes for null. Both callers validate info->codes via XextCheckExtension/XextSimpleCheckExtension before calling this static helper, so this cannot be triggered in current code. Add a defensive early-return to make the function self-guarding and consistent with the pattern used in sibling functions. Resolves: VSMGWL-85794 [Internal] Commit_Type: Bugfix Platforms: Gen8_12, Xe_Hpm, Xe_Lpm, Xe2_Hpm, Xe2_Lpm, Xe3_Hpm, Xe3_Lpm OS: Linux Feature impact: Misc Resolves: VSMGWL-85794 Related-to: N/A Co-Authored-By: Claude Code <noreply@anthropic.com>
intel-mediadev
marked this pull request as ready for review
October 23, 2026 04:25
XinfengZhang
approved these changes
Oct 23, 2026
Contributor
Author
|
/test skip-reviewer-check timeout=24 fail_retry=2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Media_Common][Coverity] Fix NULL_FIELD dereferences in va_trace and va_dri2
Fix two Coverity NULL_FIELD defects (CID 3528231, CID 3660939):
va/va_trace.c (CID 3528231): In va_TraceVPrint(), fp_log is read from
trace_ctx->plog_file->fp_log and passed directly to vfprintf/fflush without
a null check. Since fp_log is set from fopen() output (which can return NULL
on failure), dereferencing it unconditionally causes undefined behavior. All
other sites in the file that use fp_log check it for null first (lines 744,
920, 2113, 4307). Add the missing null guard before the FILE* use.
va/x11/va_dri2.c (CID 3660939): VA_DRI2GetBuffers_internal() dereferences
info->codes->major_opcode without checking info->codes for null. Both callers
validate info->codes via XextCheckExtension/XextSimpleCheckExtension before
calling this static helper, so this cannot be triggered in current code.
Add a defensive early-return to make the function self-guarding and consistent
with the pattern used in sibling functions.
Resolves: VSMGWL-85794
[Internal]
Commit_Type: Bugfix
Platforms: Gen8_12, Xe_Hpm, Xe_Lpm, Xe2_Hpm, Xe2_Lpm, Xe3_Hpm, Xe3_Lpm
OS: Linux
Feature impact: Misc
Resolves: VSMGWL-85794
Related-to: N/A
Co-Authored-By: Claude Code noreply@anthropic.com