Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input stream fix #442

Merged
merged 3 commits into from
Aug 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 0 additions & 60 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
- Fixed Loop count interpretation - [#430](https://github.com/koral--/android-gif-drawable/pull/430)
- Fixed direct byte buffer input source handling - [#434](https://github.com/koral--/android-gif-drawable/issues/434)
- Fixed changing input source in `GifTextureView` - [#429](https://github.com/koral--/android-gif-drawable/issues/429)
- Android Support library updated to 26.0.0
- Android Support library updated to 26.0.1
- Android gradle plugin updated to 2.3.3
- Gradle wrapper regenerated with 4.0.1
- Gradle wrapper regenerated with 4.1
- NDK version updated to r15c
- Mockito updated to 2.7.48
- Build tools updated to 26.0.1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
android-gif-drawable
====================
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/pl.droidsonroids.gif/android-gif-drawable/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/pl.droidsonroids.gif/android-gif-drawable)
[![Build Status](https://travis-ci.org/koral--/android-gif-drawable.png?branch=master)](https://travis-ci.org/koral--/android-gif-drawable)
[![Build Status](https://www.bitrise.io/app/78fd40a5596e97e7/status.svg?token=SMUtlPklcIRBODd513ZdiQ&branch=master)](https://www.bitrise.io/app/78fd40a5596e97e7)
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-android--gif--drawable-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1147)
[![Android-Libs](https://img.shields.io/badge/Android--Libs-android--gif--drawable-orange.svg?style=flat)](http://android-libs.com/lib/android-gif-drawable)
[![Android Weekly](http://img.shields.io/badge/Android%20Weekly-%2393-2CB3E5.svg?style=flat)](http://androidweekly.net/issues/issue-93)
Expand Down
6 changes: 5 additions & 1 deletion android-gif-drawable/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ android {
buildTypes {
release {
signingConfig signingConfigs.release
if (isDebugBuild()) {
debuggable true
jniDebuggable true
}
}
}
testOptions {
Expand All @@ -67,7 +71,7 @@ dependencies {
provided "com.android.support:support-annotations:$versions.androidSupport"
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.8.47'
testCompile 'org.robolectric:robolectric:3.4'
testCompile 'org.robolectric:robolectric:3.4.2'
testCompile 'org.assertj:assertj-core:3.8.0'
testCompile 'net.jodah:concurrentunit:0.4.2'
testCompile 'org.khronos:opengl-api:gl1.1-android-2.1_r1'
Expand Down
11 changes: 10 additions & 1 deletion android-gif-drawable/src/main/c/gif.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ static jint bufferUpTo(JNIEnv *env, StreamContainer *sc, size_t size) {
totalLength += length;
} else {
if ((*env)->ExceptionCheck(env)) {
#ifdef DEBUG
(*env)->ExceptionDescribe(env);
#endif
(*env)->ExceptionClear(env);
}
break;
Expand Down Expand Up @@ -106,6 +109,9 @@ int streamRewind(GifInfo *info) {
}
(*env)->CallVoidMethod(env, sc->stream, sc->resetMethodID);
if ((*env)->ExceptionCheck(env)) {
#ifdef DEBUG
(*env)->ExceptionDescribe(env);
#endif
(*env)->ExceptionClear(env);
info->gifFilePtr->Error = D_GIF_ERR_REWIND_FAILED;
return -1;
Expand Down Expand Up @@ -273,14 +279,17 @@ Java_pl_droidsonroids_gif_GifInfoHandle_openStream(JNIEnv *env, jclass __unused
container->markCalled = false;
descriptor.GifFileIn = DGifOpen(container, &streamRead, &descriptor.Error);

(*env)->CallVoidMethod(env, stream, markMethodID, LONG_MAX);
(*env)->CallVoidMethod(env, stream, markMethodID, INT32_MAX);

if (!(*env)->ExceptionCheck(env)) {
GifInfo *info = createGifInfo(&descriptor, env);
container->markCalled = true;
container->bufferPosition = 0;
return (jlong) (intptr_t) info;
} else {
#ifdef DEBUG
(*env)->ExceptionDescribe(env);
#endif
(*env)->DeleteGlobalRef(env, container->stream);
(*env)->DeleteGlobalRef(env, container->buffer);
free(container);
Expand Down
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ buildscript {
}

plugins {
id 'com.gradle.build-scan' version '1.8'
id "com.gradle.build-scan" version "1.8"
id "pl.droidsonroids.ui.test" version "2.0.0"
}

buildScan {
Expand All @@ -26,7 +27,7 @@ ext {
targetSdk : 26,
minSdk : 9,
buildTools : '26.0.1',
androidSupport: '26.0.0'
androidSupport: '26.0.1'
]
}

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Tue Jul 18 22:21:18 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip