01 · Before and afterThe pattern
// before: proves the old attack is blocked
TestOrientation_HugeArray_IsSkipped()
// after: proves the worst accepted input stays cheap
func TestOrientation_WorstAllowed(t *testing.T) {
img := buildEXIF(offsetsPerTag(2), entriesPerDir(65535)) // max under the cap
start := time.Now(); _, _ = GetOrientation(img)
require.Less(t, time.Since(start), time.Second)
}02 · Run it on your appThe check
For each input limit you added for safety, do you have a test that feeds the largest input the limit accepts and measures the cost?
If the honest answer is no or not sure, this is worth a look before it reaches production.