From patchwork Wed Jan 29 23:32:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 17617 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 29A1D449B77 for ; Thu, 30 Jan 2020 01:32:49 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 07C9568979C; Thu, 30 Jan 2020 01:32:49 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E387268816F for ; Thu, 30 Jan 2020 01:32:42 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id CCFAAE3B05; Thu, 30 Jan 2020 00:32:42 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kEYTdOD3fPvd; Thu, 30 Jan 2020 00:32:40 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 78BB4E378F; Thu, 30 Jan 2020 00:32:40 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Thu, 30 Jan 2020 00:32:30 +0100 Message-Id: <20200129233235.3325-1-cus@passwd.hu> X-Mailer: git-send-email 2.16.4 Subject: [FFmpeg-devel] [PATCH 1/6] avutil/common: use unsigned int in GET_UTF8 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Right shift of signed value is impelentation defined. Signed-off-by: Marton Balint --- libavutil/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/common.h b/libavutil/common.h index f09f0b486b..5568754bb9 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -389,7 +389,7 @@ static av_always_inline av_const int av_parity_c(uint32_t v) if ((val & 0xc0) == 0x80 || val >= 0xFE)\ ERROR\ while (val & top) {\ - int tmp= (GET_BYTE) - 128;\ + unsigned int tmp = (GET_BYTE) - 128;\ if(tmp>>6)\ ERROR\ val= (val<<6) + tmp;\ From patchwork Wed Jan 29 23:32:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 17618 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id F3031449B77 for ; Thu, 30 Jan 2020 01:32:50 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DD68C68AF82; Thu, 30 Jan 2020 01:32:50 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 316D0689BD5 for ; Thu, 30 Jan 2020 01:32:45 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 1C5DAE378F; Thu, 30 Jan 2020 00:32:45 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id A2G2lxaFyYtn; Thu, 30 Jan 2020 00:32:43 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 97ED2E3C41; Thu, 30 Jan 2020 00:32:43 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Thu, 30 Jan 2020 00:32:31 +0100 Message-Id: <20200129233235.3325-2-cus@passwd.hu> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200129233235.3325-1-cus@passwd.hu> References: <20200129233235.3325-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 2/6] avutil/common: add parenthesis around GET_16BIT in GET_UTF16 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Marton Balint --- libavutil/common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavutil/common.h b/libavutil/common.h index 5568754bb9..02671190a6 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -408,11 +408,11 @@ static av_always_inline av_const int av_parity_c(uint32_t v) * typically a goto statement. */ #define GET_UTF16(val, GET_16BIT, ERROR)\ - val = GET_16BIT;\ + val = (GET_16BIT);\ {\ unsigned int hi = val - 0xD800;\ if (hi < 0x800) {\ - val = GET_16BIT - 0xDC00;\ + val = (GET_16BIT) - 0xDC00;\ if (val > 0x3FFU || hi > 0x3FFU)\ ERROR\ val += (hi<<10) + 0x10000;\ From patchwork Wed Jan 29 23:32:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 17619 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id E7A76449B77 for ; Thu, 30 Jan 2020 01:32:53 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D28AB68B1E3; Thu, 30 Jan 2020 01:32:53 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 39E9468A41E for ; Thu, 30 Jan 2020 01:32:47 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 1D4CAE3B00; Thu, 30 Jan 2020 00:32:47 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BtWBf3SqJjao; Thu, 30 Jan 2020 00:32:45 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id B4BC9E3C40; Thu, 30 Jan 2020 00:32:45 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Thu, 30 Jan 2020 00:32:32 +0100 Message-Id: <20200129233235.3325-3-cus@passwd.hu> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200129233235.3325-1-cus@passwd.hu> References: <20200129233235.3325-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 3/6] avutil/common: put ERROR statements into separate code blocks in GET_UTF8/16 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Marton Balint --- libavutil/common.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavutil/common.h b/libavutil/common.h index 02671190a6..e6f076a13c 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -387,11 +387,11 @@ static av_always_inline av_const int av_parity_c(uint32_t v) {\ uint32_t top = (val & 128) >> 1;\ if ((val & 0xc0) == 0x80 || val >= 0xFE)\ - ERROR\ + {ERROR}\ while (val & top) {\ unsigned int tmp = (GET_BYTE) - 128;\ if(tmp>>6)\ - ERROR\ + {ERROR}\ val= (val<<6) + tmp;\ top <<= 5;\ }\ @@ -414,7 +414,7 @@ static av_always_inline av_const int av_parity_c(uint32_t v) if (hi < 0x800) {\ val = (GET_16BIT) - 0xDC00;\ if (val > 0x3FFU || hi > 0x3FFU)\ - ERROR\ + {ERROR}\ val += (hi<<10) + 0x10000;\ }\ }\ From patchwork Wed Jan 29 23:32:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 17620 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id A96F4449B77 for ; Thu, 30 Jan 2020 01:32:55 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 95C2868B0FD; Thu, 30 Jan 2020 01:32:55 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 776FB68B00B for ; Thu, 30 Jan 2020 01:32:48 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 5FFDCE3C41; Thu, 30 Jan 2020 00:32:48 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y4b8_prErPT4; Thu, 30 Jan 2020 00:32:47 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 3A9CCE3C40; Thu, 30 Jan 2020 00:32:47 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Thu, 30 Jan 2020 00:32:33 +0100 Message-Id: <20200129233235.3325-4-cus@passwd.hu> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200129233235.3325-1-cus@passwd.hu> References: <20200129233235.3325-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 4/6] avutil/common: warn about possible move of the data pointer after the last 0 byte in GET_UTF8 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Marton Balint --- libavutil/common.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavutil/common.h b/libavutil/common.h index e6f076a13c..142ff9abe7 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -373,7 +373,9 @@ static av_always_inline av_const int av_parity_c(uint32_t v) * @param GET_BYTE Expression reading one byte from the input. * Evaluated up to 7 times (4 for the currently * assigned Unicode range). With a memory buffer - * input, this could be *ptr++. + * input, this could be *ptr++, or if you want to make sure + * that *ptr stops at the end of a NULL terminated string then + * *ptr ? *ptr++ : 0 * @param ERROR Expression to be evaluated on invalid input, * typically a goto statement. * From patchwork Wed Jan 29 23:32:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 17621 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 7E55F449B77 for ; Thu, 30 Jan 2020 01:32:57 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6BF9768B3CC; Thu, 30 Jan 2020 01:32:57 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 110E0688390 for ; Thu, 30 Jan 2020 01:32:50 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id EEFC5E3C43; Thu, 30 Jan 2020 00:32:49 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MxGeIkQGVViX; Thu, 30 Jan 2020 00:32:48 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 7A9C9E3B05; Thu, 30 Jan 2020 00:32:48 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Thu, 30 Jan 2020 00:32:34 +0100 Message-Id: <20200129233235.3325-5-cus@passwd.hu> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200129233235.3325-1-cus@passwd.hu> References: <20200129233235.3325-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 5/6] avfilter/vf_drawtext: use replacement chars for invalid UTF8 sequences X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" continue is explicitly disallowed for GET_UTF8, so let's fix that as well. Fixes crash with invalid UTF8 sequences. Signed-off-by: Marton Balint --- libavfilter/vf_drawtext.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c index aea17b6793..ed10175af0 100644 --- a/libavfilter/vf_drawtext.c +++ b/libavfilter/vf_drawtext.c @@ -1225,7 +1225,8 @@ static int draw_glyphs(DrawTextContext *s, AVFrame *frame, for (i = 0, p = text; *p; i++) { FT_Bitmap bitmap; Glyph dummy = { 0 }; - GET_UTF8(code, *p++, continue;); + GET_UTF8(code, *p++, code = 0xfffd; goto continue_on_invalid;); +continue_on_invalid: /* skip new line chars, just go to new line */ if (code == '\n' || code == '\r' || code == '\t') @@ -1363,7 +1364,8 @@ static int draw_text(AVFilterContext *ctx, AVFrame *frame, /* load and cache glyphs */ for (i = 0, p = text; *p; i++) { - GET_UTF8(code, *p++, continue;); + GET_UTF8(code, *p++, code = 0xfffd; goto continue_on_invalid;); +continue_on_invalid: /* get glyph */ dummy.code = code; @@ -1386,7 +1388,8 @@ static int draw_text(AVFilterContext *ctx, AVFrame *frame, /* compute and save position for each glyph */ glyph = NULL; for (i = 0, p = text; *p; i++) { - GET_UTF8(code, *p++, continue;); + GET_UTF8(code, *p++, code = 0xfffd; goto continue_on_invalid2;); +continue_on_invalid2: /* skip the \n in the sequence \r\n */ if (prev_code == '\r' && code == '\n') From patchwork Wed Jan 29 23:32:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 17622 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 33D18449B77 for ; Thu, 30 Jan 2020 01:33:01 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2147C68B3F2; Thu, 30 Jan 2020 01:33:01 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3B21D68A171 for ; Thu, 30 Jan 2020 01:32:52 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 26FAEE3B05; Thu, 30 Jan 2020 00:32:52 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Rj5Pgm5g4-9L; Thu, 30 Jan 2020 00:32:51 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 95228E378F; Thu, 30 Jan 2020 00:32:50 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Thu, 30 Jan 2020 00:32:35 +0100 Message-Id: <20200129233235.3325-6-cus@passwd.hu> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200129233235.3325-1-cus@passwd.hu> References: <20200129233235.3325-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 6/6] avfilter/vf_drawtext: do not overread text if the last UTF8 sequence is invalid X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Marton Balint --- libavfilter/vf_drawtext.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c index ed10175af0..b58556e0f1 100644 --- a/libavfilter/vf_drawtext.c +++ b/libavfilter/vf_drawtext.c @@ -1225,7 +1225,7 @@ static int draw_glyphs(DrawTextContext *s, AVFrame *frame, for (i = 0, p = text; *p; i++) { FT_Bitmap bitmap; Glyph dummy = { 0 }; - GET_UTF8(code, *p++, code = 0xfffd; goto continue_on_invalid;); + GET_UTF8(code, *p ? *p++ : 0, code = 0xfffd; goto continue_on_invalid;); continue_on_invalid: /* skip new line chars, just go to new line */ @@ -1364,7 +1364,7 @@ static int draw_text(AVFilterContext *ctx, AVFrame *frame, /* load and cache glyphs */ for (i = 0, p = text; *p; i++) { - GET_UTF8(code, *p++, code = 0xfffd; goto continue_on_invalid;); + GET_UTF8(code, *p ? *p++ : 0, code = 0xfffd; goto continue_on_invalid;); continue_on_invalid: /* get glyph */ @@ -1388,7 +1388,7 @@ continue_on_invalid: /* compute and save position for each glyph */ glyph = NULL; for (i = 0, p = text; *p; i++) { - GET_UTF8(code, *p++, code = 0xfffd; goto continue_on_invalid2;); + GET_UTF8(code, *p ? *p++ : 0, code = 0xfffd; goto continue_on_invalid2;); continue_on_invalid2: /* skip the \n in the sequence \r\n */