DrKLO/Telegram · error
-merge parameter must be less than 48.\n
Error message
-merge parameter must be less than 48.\n
What it means
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'.
Source
Thrown at TMessagesProj/jni/opus/src/repacketizer_demo.c:86
if (argc < 3)
{
usage(argv[0]);
return EXIT_FAILURE;
}
for (i=1;i<argc-2;i++)
{
if (strcmp(argv[i], "-merge")==0)
{
merge = atoi(argv[i+1]);
if(merge<1)
{
fprintf(stderr, "-merge parameter must be at least 1.\n");
return EXIT_FAILURE;
}
if(merge>48)
{
fprintf(stderr, "-merge parameter must be less than 48.\n");
return EXIT_FAILURE;
}
i++;
} else if (strcmp(argv[i], "-split")==0)
split = 1;
else
{
fprintf(stderr, "Unknown option: %s\n", argv[i]);
usage(argv[0]);
return EXIT_FAILURE;
}
}
fin = fopen(argv[argc-2], "r");
if(fin==NULL)
{
fprintf(stderr, "Error opening input file: %s\n", argv[argc-2]);
return EXIT_FAILURE;
}View on GitHub (pinned to 45ab8f4308)
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.
Example fix
// before repacketizer_demo -merge 100 in.oct out.oct // after repacketizer_demo -merge 48 in.oct out.oct
Defensive patterns
Strategy: validation
Validate before calling
int merge = atoi(arg);
if (merge > 48) {
fprintf(stderr, "-merge parameter must be at most 48.\n");
return EXIT_FAILURE;
} Prevention
- Remember the 48-packet buffer limit is hardcoded in the tool's array declarations.
- For large batch operations, chain multiple repacketizer_demo invocations.
When it happens
Trigger: Passing `-merge 49` or any larger value. The check at line 84 fires when merge > 48.
Common situations: Attempting to batch a large number of packets; copy-paste from documentation that suggested a higher count; misunderstanding the buffer limit.
Related errors
- usage: %s [options] input_file output_file\n
- -merge parameter must be at least 1.\n
- Unknown option: %s\n
- Error opening input file: %s\n
- Error opening output file: %s\n
AI-assisted analysis of DrKLO/Telegram@45ab8f4308 (2026-08-14).
Data as JSON: /api/errors/e6c14eefcca70edc.
Report an issue: GitHub.