Commit d4f0c5f1 authored by Martin Storsjö's avatar Martin Storsjö Committed by Jean-Baptiste Kempf

omxil: Only print psz_role if OMX_ComponentRoleEnum succeeded

Earlier, an uninitialized string would be printed if
OMX_ComponentRoleEnum failed (or if it was unimplemented, see
omxil_utils.h), potentially leading to out of bounds reads.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent c7f563eb
...@@ -577,8 +577,11 @@ static OMX_ERRORTYPE InitialiseComponent(decoder_t *p_dec, ...@@ -577,8 +577,11 @@ static OMX_ERRORTYPE InitialiseComponent(decoder_t *p_dec,
} }
strncpy(p_sys->psz_component, psz_component, OMX_MAX_STRINGNAME_SIZE-1); strncpy(p_sys->psz_component, psz_component, OMX_MAX_STRINGNAME_SIZE-1);
OMX_ComponentRoleEnum(omx_handle, psz_role, 0); omx_error = OMX_ComponentRoleEnum(omx_handle, psz_role, 0);
if(omx_error == OMX_ErrorNone)
msg_Dbg(p_dec, "loaded component %s of role %s", psz_component, psz_role); msg_Dbg(p_dec, "loaded component %s of role %s", psz_component, psz_role);
else
msg_Dbg(p_dec, "loaded component %s", psz_component);
PrintOmx(p_dec, omx_handle, OMX_ALL); PrintOmx(p_dec, omx_handle, OMX_ALL);
/* Set component role */ /* Set component role */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment