discord-jadx/app/src/main/java/c/f/i/d.java

87 lines
2.1 KiB
Java

package c.f.i;
import c.f.d.d.m;
import c.f.i.c;
import com.airbnb.lottie.parser.AnimatableValueParser;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Objects;
/* compiled from: ImageFormatChecker */
public class d {
public static d a;
public int b;
/* renamed from: c reason: collision with root package name */
public List<c.a> f413c;
public final c.a d = new a();
public d() {
d();
}
public static c a(InputStream inputStream) throws IOException {
int i;
d c2 = c();
Objects.requireNonNull(c2);
Objects.requireNonNull(inputStream);
int i2 = c2.b;
byte[] bArr = new byte[i2];
AnimatableValueParser.j(Boolean.valueOf(i2 >= i2));
if (inputStream.markSupported()) {
try {
inputStream.mark(i2);
i = AnimatableValueParser.b2(inputStream, bArr, 0, i2);
} finally {
inputStream.reset();
}
} else {
i = AnimatableValueParser.b2(inputStream, bArr, 0, i2);
}
c b = c2.d.b(bArr, i);
if (!(b == null || b == c.a)) {
return b;
}
List<c.a> list = c2.f413c;
if (list != null) {
for (c.a aVar : list) {
c b2 = aVar.b(bArr, i);
if (!(b2 == null || b2 == c.a)) {
return b2;
}
}
}
return c.a;
}
public static c b(InputStream inputStream) {
try {
return a(inputStream);
} catch (IOException e) {
m.a(e);
throw new RuntimeException(e);
}
}
public static synchronized d c() {
d dVar;
synchronized (d.class) {
if (a == null) {
a = new d();
}
dVar = a;
}
return dVar;
}
public final void d() {
this.b = this.d.a();
List<c.a> list = this.f413c;
if (list != null) {
for (c.a aVar : list) {
this.b = Math.max(this.b, aVar.a());
}
}
}
}