{"record":{"id":"d99325e8d5b1751c","repo":"DrKLO/Telegram","slug":"1-path-to-jpg-input-file","errorCode":null,"errorMessage":"1. Path to JPG input file\n","messagePattern":"1\\. Path to JPG input file\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"TMessagesProj/jni/mozjpeg/jpegyuv.c","lineNumber":65,"sourceCode":"  int luma_width;\n  int luma_height;\n  int chroma_width;\n  int chroma_height;\n  int frame_width;\n  int yuv_size;\n  JSAMPLE *jpg_buffer;\n  JSAMPROW yrow_pointer[16];\n  JSAMPROW cbrow_pointer[8];\n  JSAMPROW crrow_pointer[8];\n  JSAMPROW *plane_pointer[3];\n  unsigned char *yuv_buffer;\n  int x;\n  int y;\n  FILE *yuv_fd;\n\n  if (argc != 3) {\n    fprintf(stderr, \"Required arguments:\\n\");\n    fprintf(stderr, \"1. Path to JPG input file\\n\");\n    fprintf(stderr, \"2. Path to YUV output file\\n\");\n    return 1;\n  }\n\n  /* Will check these for validity when opening via 'fopen'. */\n  jpg_path = argv[1];\n  yuv_path = argv[2];\n\n  cinfo.err = jpeg_std_error(&jerr);\n  jpeg_create_decompress(&cinfo);\n\n  jpg_fd = fopen(jpg_path, \"rb\");\n  if (!jpg_fd) {\n    fprintf(stderr, \"Invalid path to JPEG file!\\n\");\n    return 1;\n  }\n\n  jpeg_stdio_src(&cinfo, jpg_fd);","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/DrKLO/Telegram/blob/45ab8f4308496e1f01026a97fcdb0d58a5274474/TMessagesProj/jni/mozjpeg/jpegyuv.c#L47-L83","documentation":"This is the second line of the usage message printed when argc != 3 (jpegyuv.c:65). It specifies the first required argument: the path to the JPG input file. It is always printed together with error 153 as part of the same usage block. By itself it indicates the caller omitted or miscounted arguments.","triggerScenarios":"Same as error 153: argc != 3. This line specifically communicates that the first positional argument must be a valid JPEG file path.","commonSituations":"JNI caller passes only the output path, or passes arguments in the wrong order (YUV output first, JPEG input second). A shell script forgets to pass the input path variable.","solutions":["Pass arguments in the correct order: first the JPEG input, then the YUV output","Validate both paths are non-NULL and non-empty before calling jpegyuv","Add an argument-count assertion in the JNI wrapper"],"exampleFix":"// before (wrong order)\njpegyuv yuv_output.jpg input.jpg\n\n// after (correct order)\njpegyuv input.jpg yuv_output.yuv","handlingStrategy":"validation","validationCode":"// Ensure the first positional argument is a non-empty path string\nint validate_args(int argc, char **argv) {\n    if (argc != 3) return -1;\n    // First arg (after program name) must be a non-empty, readable path\n    if (argv[1] == NULL || strlen(argv[1]) == 0) return -1;\n    if (argv[2] == NULL || strlen(argv[2]) == 0) return -1;\n    return 0;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass arguments in the documented order: JPEG input first, YUV output second","Validate that both paths are non-empty before calling jpegyuv","In JNI, pass the return of getAbsolutePath() to ensure valid paths"],"tags":["jpeg","jpegyuv","cli-arguments","usage","argument-order"],"backgroundTag":null,"analyzedSha":"45ab8f4308496e1f01026a97fcdb0d58a5274474","analyzedAt":"2026-08-14T05:19:30.815Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}