mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 14:42:30 +00:00
Prevent 'dereference before null check'
This commit is contained in:
parent
b9104f38b8
commit
aa47903520
@ -69,6 +69,8 @@ void task_file_load_handler(retro_task_t *task)
|
|||||||
{
|
{
|
||||||
nbio_handle_t *nbio = (nbio_handle_t*)task->state;
|
nbio_handle_t *nbio = (nbio_handle_t*)task->state;
|
||||||
|
|
||||||
|
if (nbio)
|
||||||
|
{
|
||||||
switch (nbio->status)
|
switch (nbio->status)
|
||||||
{
|
{
|
||||||
case NBIO_STATUS_INIT:
|
case NBIO_STATUS_INIT:
|
||||||
@ -76,6 +78,7 @@ void task_file_load_handler(retro_task_t *task)
|
|||||||
{
|
{
|
||||||
const char *fullpath = nbio->path;
|
const char *fullpath = nbio->path;
|
||||||
struct nbio_t *handle = nbio_open(fullpath, NBIO_READ);
|
struct nbio_t *handle = nbio_open(fullpath, NBIO_READ);
|
||||||
|
|
||||||
if (handle)
|
if (handle)
|
||||||
{
|
{
|
||||||
nbio->handle = handle;
|
nbio->handle = handle;
|
||||||
@ -127,6 +130,7 @@ void task_file_load_handler(retro_task_t *task)
|
|||||||
task_set_finished(task, true);
|
task_set_finished(task, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (task_get_cancelled(task))
|
if (task_get_cancelled(task))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user