@@ -210,76 +210,6 @@ int vtkBase64Utilities::DecodeTriplet(unsigned char i0,
210210 return 3 ;
211211}
212212
213- #if !defined(VTK_LEGACY_REMOVE)
214- // ----------------------------------------------------------------------------
215- unsigned long vtkBase64Utilities::Decode (const unsigned char *input,
216- unsigned long length,
217- unsigned char *output,
218- unsigned long max_input_length)
219- {
220- VTK_LEGACY_REPLACED_BODY (Decode, " VTK 7.1" , DecodeSafely);
221-
222- const unsigned char *ptr = input;
223- unsigned char *optr = output;
224-
225- // Decode complete triplet
226-
227- if (max_input_length)
228- {
229- const unsigned char *end = input + max_input_length;
230- while (ptr < end)
231- {
232- int len =
233- vtkBase64Utilities::DecodeTriplet (ptr[0 ], ptr[1 ], ptr[2 ], ptr[3 ],
234- &optr[0 ], &optr[1 ], &optr[2 ]);
235- optr += len;
236- if (len < 3 )
237- {
238- return optr - output;
239- }
240- ptr += 4 ;
241- }
242- }
243- else
244- {
245- unsigned char *oend = output + length;
246- while ((oend - optr) >= 3 )
247- {
248- int len =
249- vtkBase64Utilities::DecodeTriplet (ptr[0 ], ptr[1 ], ptr[2 ], ptr[3 ],
250- &optr[0 ], &optr[1 ], &optr[2 ]);
251- optr += len;
252- if (len < 3 )
253- {
254- return optr - output;
255- }
256- ptr += 4 ;
257- }
258-
259- // Decode the last triplet
260-
261- unsigned char temp;
262- if (oend - optr == 2 )
263- {
264- int len =
265- vtkBase64Utilities::DecodeTriplet (ptr[0 ], ptr[1 ], ptr[2 ], ptr[3 ],
266- &optr[0 ], &optr[1 ], &temp);
267- optr += (len > 2 ? 2 : len);
268- }
269- else if (oend - optr == 1 )
270- {
271- unsigned char temp2;
272- int len =
273- vtkBase64Utilities::DecodeTriplet (ptr[0 ], ptr[1 ], ptr[2 ], ptr[3 ],
274- &optr[0 ], &temp, &temp2);
275- optr += (len > 2 ? 2 : len);
276- }
277- }
278-
279- return optr - output;
280- }
281- #endif
282-
283213// ----------------------------------------------------------------------------
284214size_t vtkBase64Utilities::DecodeSafely (const unsigned char *input,
285215 size_t inputLen,
0 commit comments