summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2014-03-04 13:02:15 +0000
committerSteve Kondik <steve@cyngn.com>2015-03-28 14:58:54 -0700
commitd87286fe5446e3d797290fa48b2369c1d0e2144b (patch)
tree09b40781a33aaa07c64b26cc1c338d6f59928818 /src
parent314380d8cf039621a0d0f6adaf324e2de80aaad4 (diff)
downloadandroid_packages_apps_Gallery2-d87286fe5446e3d797290fa48b2369c1d0e2144b.zip
android_packages_apps_Gallery2-d87286fe5446e3d797290fa48b2369c1d0e2144b.tar.gz
android_packages_apps_Gallery2-d87286fe5446e3d797290fa48b2369c1d0e2144b.tar.bz2
Camera: Fix out-of-order operations while setting up the editor
The buffer's producer is created by the cache pipeline generation, so verifying that it isn't null before calling compute() is wrong. This breaks a few devices, and should actually break them all, so fix it; only check if getProducer() is valid after running setProducer() Change-Id: I9d7d03fa9c9eb7063daef2ae28a78cd70b7a5ef3
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/UpdatePreviewTask.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/filtershow/pipeline/UpdatePreviewTask.java b/src/com/android/gallery3d/filtershow/pipeline/UpdatePreviewTask.java
index 5375c25..a55abca 100644
--- a/src/com/android/gallery3d/filtershow/pipeline/UpdatePreviewTask.java
+++ b/src/com/android/gallery3d/filtershow/pipeline/UpdatePreviewTask.java
@@ -57,9 +57,11 @@ public class UpdatePreviewTask extends ProcessingTask {
SharedBuffer buffer = MasterImage.getImage().getPreviewBuffer();
SharedPreset preset = MasterImage.getImage().getPreviewPreset();
ImagePreset renderingPreset = preset.dequeuePreset();
- if ( (buffer != null) && (renderingPreset != null) &&
- (buffer.getProducer() != null)) {
+ if ( (buffer != null) && (renderingPreset != null)) {
mPreviewPipeline.compute(buffer, renderingPreset, 0);
+ if ( buffer.getProducer() == null) {
+ return null;
+ }
// set the preset we used in the buffer for later inspection UI-side
buffer.getProducer().setPreset(renderingPreset);
buffer.getProducer().sync();