mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-27 06:11:51 +00:00
Create rpng_nbio_is_valid
This commit is contained in:
parent
0676738140
commit
09aac8a320
@ -248,3 +248,14 @@ bool rpng_nbio_load_image_argb_start(struct rpng_t *rpng)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rpng_nbio_is_valid(struct rpng_t *rpng)
|
||||
{
|
||||
if (rpng->has_ihdr)
|
||||
return true;
|
||||
if (rpng->has_idat)
|
||||
return true;
|
||||
if (rpng->has_iend)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
@ -105,6 +105,8 @@ bool rpng_load_image_argb(const char *path, uint32_t **data,
|
||||
|
||||
struct rpng_t *rpng_nbio_load_image_argb_init(const char *path);
|
||||
|
||||
bool rpng_nbio_is_valid(struct rpng_t *rpng);
|
||||
|
||||
void rpng_nbio_load_image_free(struct rpng_t *rpng);
|
||||
|
||||
bool rpng_nbio_load_image_argb_iterate(uint8_t *buf,
|
||||
|
@ -185,9 +185,7 @@ static int cb_image_menu_generic(nbio_handle_t *nbio)
|
||||
if (!nbio)
|
||||
return -1;
|
||||
|
||||
if ( !nbio->image.handle->has_ihdr ||
|
||||
!nbio->image.handle->has_idat ||
|
||||
!nbio->image.handle->has_iend)
|
||||
if (!rpng_nbio_is_valid(nbio->image.handle))
|
||||
return -1;
|
||||
|
||||
retval = rpng_nbio_load_image_argb_process(nbio->image.handle,
|
||||
|
Loading…
x
Reference in New Issue
Block a user