Check for invalid time formats in srt files too. If there is an exception loading the file
just throw out the entire file.
Change-Id: Ic6011f843d1c433e9d8d84281c1c98dc5deaf547
JIRA: NIGHTLIES-1552
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
ret.add(entry);
}
+ } catch (NumberFormatException nfe) {
+ // The file isn't a valid srt format
+ Log.e(TAG, nfe.getMessage(), nfe);
+ ret = null;
} catch (IOException ioe) {
// shouldn't happen
Log.e(TAG, ioe.getMessage(), ioe);
+ ret = null;
} catch (ArrayIndexOutOfBoundsException e) {
// if the time is malformed
Log.e(TAG, e.getMessage());
+ ret = null;
} finally {
if (br != null) {
try {