File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -314,12 +314,6 @@ static void parseJPEGArgs(Local<Value> arg, JpegClosure& jpegargs) {
314314}
315315#endif
316316
317- static uint32_t getSafeBufSize (Canvas* canvas) {
318- // Don't allow the buffer size to exceed the size of the canvas (#674)
319- // TODO not sure if this is really correct, but it fixed #674
320- return (std::min)(canvas->getWidth () * canvas->getHeight () * 4 , static_cast <int >(PAGE_SIZE));
321- }
322-
323317#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 16, 0)
324318
325319static inline void setPdfMetaStr (cairo_surface_t * surf, Local<Object> opts,
@@ -679,6 +673,11 @@ NAN_METHOD(Canvas::StreamPDFSync) {
679673 */
680674
681675#ifdef HAVE_JPEG
676+ static uint32_t getSafeBufSize (Canvas* canvas) {
677+ // Don't allow the buffer size to exceed the size of the canvas (#674)
678+ // TODO not sure if this is really correct, but it fixed #674
679+ return (std::min)(canvas->getWidth () * canvas->getHeight () * 4 , static_cast <int >(PAGE_SIZE));
680+ }
682681
683682NAN_METHOD (Canvas::StreamJPEGSync) {
684683 if (!info[1 ]->IsFunction ())
@@ -698,7 +697,6 @@ NAN_METHOD(Canvas::StreamJPEGSync) {
698697 }
699698 return ;
700699}
701-
702700#endif
703701
704702char *
You can’t perform that action at this time.
0 commit comments