{"record":{"id":"e6c14eefcca70edc","repo":"DrKLO/Telegram","slug":"merge-parameter-must-be-less-than-48-n","errorCode":null,"errorMessage":"-merge parameter must be less than 48.\\n","messagePattern":"-merge parameter must be less than 48\\.\\\\n","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"TMessagesProj/jni/opus/src/repacketizer_demo.c","lineNumber":86,"sourceCode":"\n   if (argc < 3)\n   {\n      usage(argv[0]);\n      return EXIT_FAILURE;\n   }\n   for (i=1;i<argc-2;i++)\n   {\n      if (strcmp(argv[i], \"-merge\")==0)\n      {\n         merge = atoi(argv[i+1]);\n         if(merge<1)\n         {\n            fprintf(stderr, \"-merge parameter must be at least 1.\\n\");\n            return EXIT_FAILURE;\n         }\n         if(merge>48)\n         {\n            fprintf(stderr, \"-merge parameter must be less than 48.\\n\");\n            return EXIT_FAILURE;\n         }\n         i++;\n      } else if (strcmp(argv[i], \"-split\")==0)\n         split = 1;\n      else\n      {\n         fprintf(stderr, \"Unknown option: %s\\n\", argv[i]);\n         usage(argv[0]);\n         return EXIT_FAILURE;\n      }\n   }\n   fin = fopen(argv[argc-2], \"r\");\n   if(fin==NULL)\n   {\n     fprintf(stderr, \"Error opening input file: %s\\n\", argv[argc-2]);\n     return EXIT_FAILURE;\n   }","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/DrKLO/Telegram/blob/45ab8f4308496e1f01026a97fcdb0d58a5274474/TMessagesProj/jni/opus/src/repacketizer_demo.c#L68-L104","documentation":"The -merge value exceeds the tool's fixed buffer capacity. The packets, len, and rng arrays are all declared with 48 elements (lines 62-64). The check `merge > 48` rejects values of 49 and above. Note: the error message says 'less than 48' but merge=48 is actually accepted (indices 0 through 47); the message is slightly misleading — it should say 'at most 48'.","triggerScenarios":"Passing `-merge 49` or any larger value. The check at line 84 fires when merge > 48.","commonSituations":"Attempting to batch a large number of packets; copy-paste from documentation that suggested a higher count; misunderstanding the buffer limit.","solutions":["Use a merge value between 1 and 48 inclusive.","If you need to process more than 48 packets at once, run the tool in multiple passes and concatenate the outputs."],"exampleFix":"// before\nrepacketizer_demo -merge 100 in.oct out.oct\n// after\nrepacketizer_demo -merge 48 in.oct out.oct","handlingStrategy":"validation","validationCode":"int merge = atoi(arg);\nif (merge > 48) {\n    fprintf(stderr, \"-merge parameter must be at most 48.\\n\");\n    return EXIT_FAILURE;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember the 48-packet buffer limit is hardcoded in the tool's array declarations.","For large batch operations, chain multiple repacketizer_demo invocations."],"tags":["opus","cli","argument-validation","buffer-limit","repacketizer"],"backgroundTag":null,"analyzedSha":"45ab8f4308496e1f01026a97fcdb0d58a5274474","analyzedAt":"2026-08-14T05:19:30.815Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}