package p138.p176.p177.p190.p240;

import com.google.android.exoplayer2.ParserException;
import java.util.Collections;
import java.util.List;
import p138.p176.p177.p190.p239.C4136;
import p138.p176.p177.p190.p239.C4140;

/* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ဨ.މ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C4165 {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final List<byte[]> f13312;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final int f13313;

    public C4165(List<byte[]> list, int i) {
        this.f13312 = list;
        this.f13313 = i;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static C4165 m6819(C4140 c4140) throws ParserException {
        try {
            c4140.m6695(21);
            int iM6702 = c4140.m6702() & 3;
            int iM67022 = c4140.m6702();
            int i = c4140.f13228;
            int i2 = 0;
            for (int i3 = 0; i3 < iM67022; i3++) {
                c4140.m6695(1);
                int iM6707 = c4140.m6707();
                for (int i4 = 0; i4 < iM6707; i4++) {
                    int iM67072 = c4140.m6707();
                    i2 += iM67072 + 4;
                    c4140.m6695(iM67072);
                }
            }
            c4140.m6693(i);
            byte[] bArr = new byte[i2];
            int i5 = 0;
            for (int i6 = 0; i6 < iM67022; i6++) {
                c4140.m6695(1);
                int iM67073 = c4140.m6707();
                for (int i7 = 0; i7 < iM67073; i7++) {
                    int iM67074 = c4140.m6707();
                    System.arraycopy(C4136.f13203, 0, bArr, i5, C4136.f13203.length);
                    int length = i5 + C4136.f13203.length;
                    System.arraycopy(c4140.f13227, c4140.f13228, bArr, length, iM67074);
                    i5 = length + iM67074;
                    c4140.m6695(iM67074);
                }
            }
            return new C4165(i2 == 0 ? null : Collections.singletonList(bArr), iM6702 + 1);
        } catch (ArrayIndexOutOfBoundsException e) {
            throw new ParserException("Error parsing HEVC config", e);
        }
    }
}
