File tree 2 files changed +8
-4
lines changed
library/src/main/java/com/bumptech/glide
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 14
14
public final class ImageHeaderParserUtils {
15
15
// 5MB. This is the max image header size we can handle, we preallocate a much smaller buffer but
16
16
// will resize up to this amount if necessary.
17
- private static final int MARK_POSITION = 5 * 1024 * 1024 ;
17
+ private static final int MARK_READ_LIMIT = 5 * 1024 * 1024 ;
18
18
19
19
private ImageHeaderParserUtils () {}
20
20
@@ -33,7 +33,7 @@ public static ImageType getType(
33
33
is = new RecyclableBufferedInputStream (is , byteArrayPool );
34
34
}
35
35
36
- is .mark (MARK_POSITION );
36
+ is .mark (MARK_READ_LIMIT );
37
37
//noinspection ForLoopReplaceableByForEach to improve perf
38
38
for (int i = 0 , size = parsers .size (); i < size ; i ++) {
39
39
ImageHeaderParser parser = parsers .get (i );
@@ -84,7 +84,7 @@ public static int getOrientation(
84
84
is = new RecyclableBufferedInputStream (is , byteArrayPool );
85
85
}
86
86
87
- is .mark (MARK_POSITION );
87
+ is .mark (MARK_READ_LIMIT );
88
88
//noinspection ForLoopReplaceableByForEach to improve perf
89
89
for (int i = 0 , size = parsers .size (); i < size ; i ++) {
90
90
ImageHeaderParser parser = parsers .get (i );
Original file line number Diff line number Diff line change @@ -20,7 +20,11 @@ public class ResourceDecoderRegistry {
20
20
public synchronized void setBucketPriorityList (@ NonNull List <String > buckets ) {
21
21
List <String > previousBuckets = new ArrayList <>(bucketPriorityList );
22
22
bucketPriorityList .clear ();
23
- bucketPriorityList .addAll (buckets );
23
+ // new ArrayList(List) and ArrayList#addAll(List) are both broken on some verisons of Android,
24
+ // see #3296
25
+ for (String bucket : buckets ) {
26
+ bucketPriorityList .add (buckets );
27
+ }
24
28
for (String previousBucket : previousBuckets ) {
25
29
if (!buckets .contains (previousBucket )) {
26
30
// Keep any buckets from the previous list that aren't included here, but but them at the
You can’t perform that action at this time.
0 commit comments