File tree 1 file changed +5
-7
lines changed
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) {
314
314
}
315
315
#endif
316
316
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
-
323
317
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 16, 0)
324
318
325
319
static inline void setPdfMetaStr (cairo_surface_t * surf, Local<Object> opts,
@@ -679,6 +673,11 @@ NAN_METHOD(Canvas::StreamPDFSync) {
679
673
*/
680
674
681
675
#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
+ }
682
681
683
682
NAN_METHOD (Canvas::StreamJPEGSync) {
684
683
if (!info[1 ]->IsFunction ())
@@ -698,7 +697,6 @@ NAN_METHOD(Canvas::StreamJPEGSync) {
698
697
}
699
698
return ;
700
699
}
701
-
702
700
#endif
703
701
704
702
char *
You can’t perform that action at this time.
0 commit comments