Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fbf35579 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "mpeg4dec: Check for invalid quant matrix" am: be78d20a am: 5bc433ba

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1505733

Change-Id: I55c198344632a4f58755618db989821598a5c31b
parents 7fa4eba5 5bc433ba
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -497,6 +497,13 @@ decode_vol:
                }
                while ((qmat[*(zigzag_inv+i)] != 0) && (++i < 64));

                /* qmatrix must have at least one non-zero value, which means
                   i would be non-zero in valid cases */
                if (i == 0)
                {
                    return PV_FAIL;
                }

                for (j = i; j < 64; j++)
                    qmat[*(zigzag_inv+j)] = qmat[*(zigzag_inv+i-1)];
            }
@@ -520,6 +527,13 @@ decode_vol:
                }
                while ((qmat[*(zigzag_inv+i)] != 0) && (++i < 64));

                /* qmatrix must have at least one non-zero value, which means
                   i would be non-zero in valid cases */
                if (i == 0)
                {
                    return PV_FAIL;
                }

                for (j = i; j < 64; j++)
                    qmat[*(zigzag_inv+j)] = qmat[*(zigzag_inv+i-1)];
            }