Extra sanity checks on sample size and resolution

Instead of rejecting the samples later when they don't fit in the
buffer, reject the entire file early.

Bug: 22882938
Change-Id: I748153b0e9e827e3f2526468756295b4b5000de6
(cherry picked from commit beef7e58c1f1837bdaed6ac37414d8c48a133813)
1 file changed