Просмотр исходного кода

先注掉二维码图片生成接口,解决掉崩溃后再放开

guohui 1 год назад
Родитель
Сommit
d5b3958ade
3 измененных файлов с 6 добавлено и 3 удалено
  1. 0 1
      pro/qrcode/qrc.c
  2. 4 0
      pro/qrcode/qrcode.c
  3. 2 2
      pro/src/sys.c

+ 0 - 1
pro/qrcode/qrc.c

@@ -78,7 +78,6 @@ int qrc_to_png(char *txt, char *path)
 {
     int r,x,y;
     QRCode qrc;
-    uint8_t blackPixel=0x00,whitePixel=0xFF;
     
     int ver=6,ecc=ECC_QUARTILE;
     uint16_t bufsz=qrcode_getBufferSize(ver);

+ 4 - 0
pro/qrcode/qrcode.c

@@ -783,6 +783,10 @@ int8_t qrcode_initBytes(QRCode *qrcode, uint8_t *modules, uint8_t version, uint8
     qrcode->ecc = ecc;
     qrcode->modules = modules;
     
+    if(!qrcode || !modules || version>40 || ecc>ECC_HIGH || length==0) {
+        return -1;
+    }
+
     uint8_t eccFormatBits = (ECC_FORMAT_BITS >> (2 * ecc)) & 0x03;
     
 #if LOCK_VERSION == 0

+ 2 - 2
pro/src/sys.c

@@ -1466,10 +1466,10 @@ int sys_get_prod(GlobalDeviceInfo *info)
     if(p) LOGD("___%s:%s\n", tok, p);
 
     sys_get_path(temp, "../web/img/shdh.png");
-    qrc_to_png(info->service.tele, temp);
+    //qrc_to_png(info->service.tele, temp);
 
     sys_get_path(temp, "../web/img/sbh.png");
-    qrc_to_png(info->product.number, temp);
+    //qrc_to_png(info->product.number, temp);
 
     free(fbuf.buf);
     return 0;