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

Commit a2deb6d7 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 am: fbf35579

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

Change-Id: I5a1954ad66de31677b6cb6d7e59063ed48039a0f
parents a696b2cf fbf35579
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)];
            }