mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
Fix crash on Android 2.2
* src/android-asset.h (AAssetManager_open): Initialize desc and asset to NULL, lest `desc' be accessed uninitialized if C_NAME does not exist in the directory tree.
This commit is contained in:
parent
a71ba898db
commit
ca4af1768d
1 changed files with 2 additions and 6 deletions
|
|
@ -186,15 +186,13 @@ static AAsset *
|
||||||
AAssetManager_open (AAssetManager *manager, const char *c_name,
|
AAssetManager_open (AAssetManager *manager, const char *c_name,
|
||||||
int mode)
|
int mode)
|
||||||
{
|
{
|
||||||
jobject desc;
|
jobject desc = NULL;
|
||||||
jstring name;
|
jstring name;
|
||||||
AAsset *asset;
|
AAsset *asset = NULL;
|
||||||
const char *asset_dir;
|
const char *asset_dir;
|
||||||
jlong st_size = -1;
|
jlong st_size = -1;
|
||||||
|
|
||||||
/* Push a local frame. */
|
/* Push a local frame. */
|
||||||
asset = NULL;
|
|
||||||
|
|
||||||
(*(manager->env))->PushLocalFrame (manager->env, 3);
|
(*(manager->env))->PushLocalFrame (manager->env, 3);
|
||||||
|
|
||||||
if ((*(manager->env))->ExceptionCheck (manager->env))
|
if ((*(manager->env))->ExceptionCheck (manager->env))
|
||||||
|
|
@ -226,8 +224,6 @@ AAssetManager_open (AAssetManager *manager, const char *c_name,
|
||||||
stream directly upon the first attempt to read from the asset,
|
stream directly upon the first attempt to read from the asset,
|
||||||
sidestepping the intermediate AssetFileDescriptor. */
|
sidestepping the intermediate AssetFileDescriptor. */
|
||||||
|
|
||||||
desc = NULL;
|
|
||||||
|
|
||||||
if (st_size < 0)
|
if (st_size < 0)
|
||||||
/* Otherwise attempt to open an ``AssetFileDescriptor''. */
|
/* Otherwise attempt to open an ``AssetFileDescriptor''. */
|
||||||
desc = (*(manager->env))->CallObjectMethod (manager->env,
|
desc = (*(manager->env))->CallObjectMethod (manager->env,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue