We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1780 - SDL_RWFromFile() sets an error on Android although a valid SDL_RWops pointer is returned.
Summary: SDL_RWFromFile() sets an error on Android although a valid SDL_RWops pointer ...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: file (show other bugs)
Version: HG 2.0
Hardware: All Android (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-01 07:38 UTC by Philipp Wiesemann
Modified: 2013-04-02 10:58 UTC (History)
0 users

See Also:


Attachments
patch for RWFromFile() setting error on fallback on Android (3.74 KB, patch)
2013-04-01 07:38 UTC, Philipp Wiesemann
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Wiesemann 2013-04-01 07:38:58 UTC
Created attachment 1094 [details]
patch for RWFromFile() setting error on fallback on Android

SDL_RWFromFile() sets an error to be queried with SDL_GetError() on Android although a valid SDL_RWops pointer is returned.

This happens if the fallback implemented in SDL_android.cpp is used to load compressed assets (see README.android in section "Loading assets") and results in a message like "java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed". I think this is confusing and not needed because the loading works as expected.

I attached a patch which changes SDL_android.cpp to not set an error if compressed assets are loaded. In this case also no Exception is queried and no additional string are created.
Comment 1 Sam Lantinga 2013-04-02 10:58:11 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL/rev/4be2c24b7de1