package o; import com.drew.imaging.riff.RiffProcessingException; import java.io.IOException; /* renamed from: o.zhp, reason: case insensitive filesystem */ /* loaded from: classes.dex */ public final class C17785zhp { private void a(Eaa eaa, int i, InterfaceC16990suK interfaceC16990suK) throws IOException { while (eaa.c() < i) { try { String str = new String(eaa.a(4)); int a = eaa.a(); if (a <= 0) { StringBuilder sb = new StringBuilder(); sb.append("Invalid chunk size: "); sb.append(a); interfaceC16990suK.b(sb.toString()); return; } if (!str.equals("LIST") && !str.equals("RIFF")) { if (!str.equals("IDIT")) { if (interfaceC16990suK.d(str)) { interfaceC16990suK.c(str, eaa.a(a)); } else { eaa.b(a); } if ((a & 1) == 1) { eaa.b(1L); } } else if (a < 2) { interfaceC16990suK.b("Chunk size too small."); } else { interfaceC16990suK.c(str, eaa.a(a - 2)); eaa.b(2L); } } String str2 = new String(eaa.a(4)); if (a < 4) { interfaceC16990suK.b("Chunk size too small."); } else if (interfaceC16990suK.c(str2)) { a(eaa, a - 4, interfaceC16990suK); } else { eaa.b(a - 4); } } catch (IOException e) { interfaceC16990suK.b(e.getMessage()); return; } } } public final void d(Eaa eaa, InterfaceC16990suK interfaceC16990suK) throws RiffProcessingException, IOException { eaa.e = false; String str = new String(eaa.a(4)); if (!str.equals("RIFF")) { throw new RiffProcessingException("Invalid RIFF header: ".concat(str)); } int a = eaa.a(); if (interfaceC16990suK.a(new String(eaa.a(4)))) { a(eaa, a - 4, interfaceC16990suK); } } }