From patchwork Wed Nov 4 13:37:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 23387 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 655C1449C3C for ; Wed, 4 Nov 2020 15:37:41 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2828F68AEEB; Wed, 4 Nov 2020 15:37:41 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 99C03687FFA for ; Wed, 4 Nov 2020 15:37:34 +0200 (EET) Received: by mail-pf1-f193.google.com with SMTP id e7so17262613pfn.12 for ; Wed, 04 Nov 2020 05:37:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=SzmHgFcCMA52AwjaJcabWbOJm4MZwhRQcefodOVi6x8=; b=HPQlXoEATNbahcZpuDPHghy6X/Lv5JWYmuECpM4Z0AcbyrG8Bd/GStrWHMOY81rI9H ZiL+LxB2C98epbTNEbL8VRlZy8HN8F8krohL45vqt4m7cOsemLEuWTMdbO2iimsauq/r o0Xburrmf8Ra1YJC+0DHMkRrunW943YybvMzYWMwq+vQefqPIrP0mAO9Z/CJikEu+b+t izu9GjmXuLW8CIUMHqxybTzvxrAdJ5XMvqIeQP+VpQTSAgHqWrOOI/lK/Muvgl87qxco aJRt2JwFVBDf9r+c6vKIFQ0zpB8nuaJrUHdBxC6lnUBNE3ewA10JDGIjq4gXARK1lI4g EN7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=SzmHgFcCMA52AwjaJcabWbOJm4MZwhRQcefodOVi6x8=; b=Y1UPyLujcpCfs99II5MbFQ/yeuF1j0AsR4Ugmq19ohpRq2EIPELmTbVgCEs10CtoHl Tcvuy+x+hF0K7dLCtz+fgJvWQ13gK7pNnPiRYhmzN/aVJFdGdX55+kBAuuxXPgP0IXID 3TmzaYf1+Gff24/6hP9lXNUttjRSKc/lrhZ6PiLj5eRmOV8eZKSzwELeaGcQ8w9t2NJy jRfSYFo+1oa9qGND219iYhM43nZZHLQRrJD2OqHS8wUjqzjQNF63/WVD/X5Oi2TKB8SO GIZHHMo2gKSn+lgpH6VLq3rFc607OM13yIUqyKhY0sCwT2V7Q29WFK+70+TpI0KvwPkM AYcA== X-Gm-Message-State: AOAM530lZq1pHXwwGRg3gpyYDRqbJpLzTaWnkUR/F0SxpWFjL6RcCrBd MYs/2RK2PhnJf0cUvsmveUnd85JeE/c= X-Google-Smtp-Source: ABdhPJw78e6AOX34Zt+U6MyZz/OXqmNeyYVBRNPuWAqVTU3lyI1zfZx9Wzo9smmKA88rv54CMHphgw== X-Received: by 2002:a17:90a:8c:: with SMTP id a12mr4340842pja.155.1604497052458; Wed, 04 Nov 2020 05:37:32 -0800 (PST) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id l22sm2644198pff.27.2020.11.04.05.37.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2020 05:37:31 -0800 (PST) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Wed, 4 Nov 2020 21:37:22 +0800 Message-Id: <1604497047-30429-1-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 Subject: [FFmpeg-devel] [PATCH 1/6] avformat/rtsp: 16384 -> SDP_MAX_SIZE 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: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang Signed-off-by: Limin Wang --- libavformat/rtsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 49c2d52..1b876c9 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -696,7 +696,7 @@ int ff_sdp_parse(AVFormatContext *s, const char *content) * * The Vorbis FMTP line can be up to 16KB - see xiph_parse_sdp_line * in rtpdec_xiph.c. */ - char buf[16384], *q; + char buf[SDP_MAX_SIZE], *q; SDPParseState sdp_parse_state = { { 0 } }, *s1 = &sdp_parse_state; p = content; From patchwork Wed Nov 4 13:37:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 23388 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 702FD449C3C for ; Wed, 4 Nov 2020 15:37:43 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 56AD768B2B1; Wed, 4 Nov 2020 15:37:43 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5570468B205 for ; Wed, 4 Nov 2020 15:37:36 +0200 (EET) Received: by mail-pg1-f194.google.com with SMTP id r10so16621217pgb.10 for ; Wed, 04 Nov 2020 05:37:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JrIH4Q5iH8YkDbhRrsmCQGL6CvXOmG7uMe9KxPtEvRU=; b=HwLDH4QKs/feRzDYAjYyL/k8pdWtS/mfJFwAST1xDR8C4C1joZl4JKO/siPeeVktIC e7FIuHea27sAKJ9FDdK+Bjo2T3dCAD5Ns/ptfC70+3VcrtgsASzc/Jch0nChDRF9m4Eg ltI7bWqqb1IZMOe9o1TeZxh7sBx4pSAK7MSwLMEj1cXNIgtqk0C0BlAL46ffS1J8aTIJ d5d0O/1kTm6mKfWfm80fiUAnnIgqSqmigCsqRUEpzPCGmZRu8pNf8km75W+ptqJdmWKy Wjt48fRF/pl4jgKBN1LP9LpIj5rHIJn9ENzBbteL+eOpX3LFyVJMZhwjysZRSkumJ4lv EAQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JrIH4Q5iH8YkDbhRrsmCQGL6CvXOmG7uMe9KxPtEvRU=; b=gS3k3EHjzq5ppHFagYwTv3EE+QdXLHY0VbcZkgB4W6B2wuq0/QpfP4uE7qoq+US8Ik FyDDb9rg++uI7qkGBXIf90/bhCZEsdXL3AXfdDwy2apfq76DhOzlqX9hjH5cxFcTUh1R DCw05pdzxjoz2xf+WPUigmBBX/IFlFMIoSMod3VmTQEoyhXFkLKeLvtW5ryceYBcs+DV dkHkRa6lbFOXQy10hDDq3/7aFBzZ1yI01eYI+ppw/TvRUcz0/Kj2QvndscgXUMs6ovD4 TzlOcvqPAO7SFI2fNx4dh96DrWJU0VePzMYKwXiAAdU8MHngXSVFNyfF0pNkOQxeF2hb XwnA== X-Gm-Message-State: AOAM5316UhK8JAw6lM6LwJxAcUL453L2csQ4HmITAC6u/xnfrpqcEhLc xccMr+WIqVRMDTlp6zsLq2HAcvi6GPo= X-Google-Smtp-Source: ABdhPJz0FPnpjL3HlI/xvyc/Wx4gBh9qHTYz/Ew4fPV2fvQaKiPqI8fqkt4y7fVaJYq2C/Zp9JwTkg== X-Received: by 2002:a17:90a:4488:: with SMTP id t8mr1484076pjg.37.1604497054256; Wed, 04 Nov 2020 05:37:34 -0800 (PST) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id l22sm2644198pff.27.2020.11.04.05.37.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2020 05:37:33 -0800 (PST) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Wed, 4 Nov 2020 21:37:23 +0800 Message-Id: <1604497047-30429-2-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1604497047-30429-1-git-send-email-lance.lmwang@gmail.com> References: <1604497047-30429-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/6] avformat/rtspdec: use SDP_MAX_SIZE for sdp array 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: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang Signed-off-by: Limin Wang --- libavformat/rtspdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c index ef084a8..3abf34b 100644 --- a/libavformat/rtspdec.c +++ b/libavformat/rtspdec.c @@ -172,7 +172,7 @@ static int rtsp_read_announce(AVFormatContext *s) { RTSPState *rt = s->priv_data; RTSPMessageHeader request = { 0 }; - char sdp[4096]; + char sdp[SDP_MAX_SIZE]; int ret; ret = rtsp_read_request(s, &request, "ANNOUNCE"); From patchwork Wed Nov 4 13:37:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 23389 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 8CD15449C3C for ; Wed, 4 Nov 2020 15:37:45 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6FA2968B31D; Wed, 4 Nov 2020 15:37:45 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EA436687FFA for ; Wed, 4 Nov 2020 15:37:37 +0200 (EET) Received: by mail-pg1-f195.google.com with SMTP id o3so16618157pgr.11 for ; Wed, 04 Nov 2020 05:37:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DZgAWksPpimn4iIYq692QTQ45i3468hqF4HgF2N4YnA=; b=O897oi9mf1opi6J+eI4u/luVBlp01y3dWxIK4uVl8QXUvGeTjojXA2Phy8PjNFpj0k 0uczmIoKIHRUSkdJWxOiUEscxUAbLAxaLLLKJclAFghs9WxOdKXUj85Uhw+Aq0NUu2Ut 71361j2c+DUJEth4VhWAV0WXJqCGspSt449G7E2yfovyZJxFwcZbPM8AUm+XHi2EaB6T GeoAT36EjKn2xdDUpRTtrQTONVxNnqP5zYepzjchuumuXM7NiRJSjM4Ow5KRRz9mDUEZ ionEQg6SJQBHA8khZhIJwcIwX7lZOpaoGteHbecDc0zrwsur+fOBRVb7XHlWBYcP8iLg 0Sng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DZgAWksPpimn4iIYq692QTQ45i3468hqF4HgF2N4YnA=; b=ARj6UtnC5cTZCJiL8c9dTZE0lI2ixyoimzHeArR8CWwVj5ZCaFHt5y2AXMFZ45w613 rF/KiSqr247TU35Zh8w+shnIE2UVfaZI4MskUCsCsF4/3N+yeVo1T9Sm4oBnorlJw66+ nSgXbaBqtCelr+XRr+dQwvx5mBq3Oh16hIWgvSWBkqyL48jVo01vGrjGc0t9UZ5EmvmB fUWRmuvPDEd/9Xa2uj/JniNHAQ1EBgFheiJ41QyfdMvqe6fCvyFRjRCkKJXld7s1+6ki v99LnpQIzb7uDTxIl6mYsetr+U4tk1YQah3ijet6zRZsDYt9Sn1yOT29llN+wBTQti/L 0dEA== X-Gm-Message-State: AOAM532zEtJJm4pNAcrtDDv8E7LZwPu0pfo2XtgySV94kxJ1fTrR7rh9 UJ7MTBjnR2LZGvZBTaMxRZ6lUHrS9iI= X-Google-Smtp-Source: ABdhPJz19P8S4ugW5dQ+izMTKS6WikDvOP4ImV+X6PMFSHA+b9oD7Ho/+F3AMvKqvYufKUuv9U4SzQ== X-Received: by 2002:a63:7f47:: with SMTP id p7mr20866770pgn.394.1604497055981; Wed, 04 Nov 2020 05:37:35 -0800 (PST) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id l22sm2644198pff.27.2020.11.04.05.37.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2020 05:37:35 -0800 (PST) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Wed, 4 Nov 2020 21:37:24 +0800 Message-Id: <1604497047-30429-3-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1604497047-30429-1-git-send-email-lance.lmwang@gmail.com> References: <1604497047-30429-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH 3/6] avformat/rtsp: move SDP_MAX_SIZE macro definition to header file 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: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang Signed-off-by: Limin Wang --- libavformat/rtsp.c | 1 - libavformat/rtsp.h | 1 + libavformat/rtspenc.c | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 1b876c9..51a360f 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -53,7 +53,6 @@ /* Default timeout values for read packet in seconds */ #define READ_PACKET_TIMEOUT_S 10 -#define SDP_MAX_SIZE 16384 #define RECVBUF_SIZE 10 * RTP_MAX_PACKET_LENGTH #define DEFAULT_REORDERING_DELAY 100000 diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h index 2b37f5b..251ed86 100644 --- a/libavformat/rtsp.h +++ b/libavformat/rtsp.h @@ -78,6 +78,7 @@ enum RTSPControlTransport { #define RTSP_DEFAULT_AUDIO_SAMPLERATE 44100 #define RTSP_RTP_PORT_MIN 5000 #define RTSP_RTP_PORT_MAX 65000 +#define SDP_MAX_SIZE 16384 /** * This describes a single item in the "Transport:" line of one stream as diff --git a/libavformat/rtspenc.c b/libavformat/rtspenc.c index 97e3ef6..d505444 100644 --- a/libavformat/rtspenc.c +++ b/libavformat/rtspenc.c @@ -34,7 +34,6 @@ #include "libavutil/time.h" #include "url.h" -#define SDP_MAX_SIZE 16384 static const AVClass rtsp_muxer_class = { .class_name = "RTSP muxer", From patchwork Wed Nov 4 13:37:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 23390 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 C99C6449C3C for ; Wed, 4 Nov 2020 15:37:46 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AC89A68B48C; Wed, 4 Nov 2020 15:37:46 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EA14F68B31D for ; Wed, 4 Nov 2020 15:37:39 +0200 (EET) Received: by mail-pl1-f193.google.com with SMTP id u2so4357888pls.10 for ; Wed, 04 Nov 2020 05:37:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iJ7NAWoId/wqECA1M3DPvuu0Yw2KmtM5Ni1uww1sGnU=; b=HMiT6z8Ko7az1IEj1vXzDPbOS0MncEGkwA7cudkYn6u92L1aq3KeyB26vZKvAN6DF5 ot63Nc8+qYkWA8Rl3KM3NCDwqwIZIvZOVObuJjjErxBhq2F/KIuLzcVNOztrPUmX2wKA lWPhaU5uK4iXa03DVClcNXZ3bYDln4HFlKLSfJABsecET3LlkWFV8IgyXs+yj8oh5ct0 svAwDHk4ckCdPAStViWgQpW/OH9kaXDl5PxUGYYcMMgsJQ9cdU/nllBK48Ghias8lM3F SM/XVrSqLoQZUH/cosjcqqxJCFG1wCp7ABpJfQPmZlXOG2SCLjI9o9vorUJzTEThbtRw iyqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iJ7NAWoId/wqECA1M3DPvuu0Yw2KmtM5Ni1uww1sGnU=; b=kO6yZ5rJzt1KtJx8W9YSeGqGh7t8g7DtoCKwerpR/tEF8OIn5F0hqfYMijljaQ+IcX qxejA/A+/a3adEfl6+AHlevBEFn/gliKdDsrNqXjr9o9KS7BNLtO9/fDVJ6uHCYjVV/d cnJevUA7HSpSje1fSnt6U5UYW2Pos2cphVuS/U/SIVLA8eJshZYbEORsBMHaO0DlFCeJ pVxIsgRwKsKyaCgOMt35b+E9rmUUEhB36Ed0LWGD22a3JNrETKnbnGD2pAJ1gpeu2daG budQTF5gCoPaIb07mjxS7PTbFycTFyH/6mdfNwaynGuuSnPFcfxGyQHhbb0QaQNS7JP/ gM7Q== X-Gm-Message-State: AOAM533C5okNPxBolDaVaBwT1MiX55SBjn2Zz29LnnbGSXfwMFuXFSvq QMPFTBoc6r/0ZV0gmKj4TtVjJF3IUso= X-Google-Smtp-Source: ABdhPJxMZgqzSoHfSDj5f0LpZ/As+9cDq7O+7ojoOm1vjJ4IehbEG8VLHNPOckpIzav/kulBEPggtA== X-Received: by 2002:a17:902:7c02:b029:d4:bf4e:4fc6 with SMTP id x2-20020a1709027c02b02900d4bf4e4fc6mr28746291pll.75.1604497057691; Wed, 04 Nov 2020 05:37:37 -0800 (PST) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id l22sm2644198pff.27.2020.11.04.05.37.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2020 05:37:37 -0800 (PST) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Wed, 4 Nov 2020 21:37:25 +0800 Message-Id: <1604497047-30429-4-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1604497047-30429-1-git-send-email-lance.lmwang@gmail.com> References: <1604497047-30429-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH 4/6] avformat/rtsp: prefer to use variable instead of type 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: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang Signed-off-by: Limin Wang --- libavformat/rtsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 51a360f..3a1afa0 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1990,7 +1990,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st, int runs = rt->initial_timeout * 1000LL / POLLING_TIME; if (!p) { - p = rt->p = av_malloc_array(2 * rt->nb_rtsp_streams + 1, sizeof(struct pollfd)); + p = rt->p = av_malloc_array(2 * rt->nb_rtsp_streams + 1, sizeof(*p)); if (!p) return AVERROR(ENOMEM); From patchwork Wed Nov 4 13:37:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 23391 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 E4D87449C3C for ; Wed, 4 Nov 2020 15:37:47 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CA82768B589; Wed, 4 Nov 2020 15:37:47 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 34AD968B368 for ; Wed, 4 Nov 2020 15:37:41 +0200 (EET) Received: by mail-pg1-f193.google.com with SMTP id z24so16657008pgk.3 for ; Wed, 04 Nov 2020 05:37:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Pbu7diWUMFazG3/pPye9KxIN8x684NiLxUiQ03PM9oc=; b=PQPBzLXrStgeS5EWHuIfMXEHd9mNW5UMXiGbdaKM4iFJhS5GAY+3qZMsNos1o5mU1m Ho0nniZvtpsiXli28hlAU0W9i1Gni/95WgzRoutFw6sMRdirsNMZsFQeztAIx9b+nfLw etqr9dY3dUaVfAu9p06w9acJumEfUWnPJ7ddGaq8OJmI6dArbPLfdXIV3er5ZT2uT0yS 3EW9THQOJxecYshEmli+L2NnoKrdUfwPxxRPbzJq64RcKMxmUv1wPp+mp8e8ZmAl6RnZ EAsW3DOKGANqJAVag+4wrH6oycb9se8T41jcykYZh5Rif5Hs+nur4xKqgBsp1FtJO8FQ Cl6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Pbu7diWUMFazG3/pPye9KxIN8x684NiLxUiQ03PM9oc=; b=ihBzWd9izxEaG75osogPeXnuNhdhRx+58i12eeZ934yVDaivxpTJEw8ke9d6umedjZ tNmOwXV/O0qbmAOqZFiuhIl6bF28yPCsSdvfJuArNaLvwwFeJ2CGW25nZLljNvycfvet cAteD3rRrs6tqkn0/k+NfjSU5kSfu7omOixU7SVHhDOstlVXTzwmQoA7NCSs1DUx0rrB Sb+1EfnA6HpIZDMlKvfNFtnSSjsBO9XK/akuxg0M5xuAQv4jkQ3Q3nKtyZORSqCy5rOq QhhonckzsvFn0NSudiESbGy5kuv2Iki9HPyG06y9ClJ8WyVL6xL9yezPd35udeBNh8D5 XozQ== X-Gm-Message-State: AOAM5338ss2ONuqRzyWT1lPqBuoO8zcJiKzYe8sjDnkJhxfY973RwPX3 yEosLEcTMJJTzoC760T0Bf8ySIViT+I= X-Google-Smtp-Source: ABdhPJy8x0sEk81hQfbsHdElRom2xpkF24nXFAeU+mFEd9RsJWrG8E0TijzpfHrCUGgelKr6z5+Csg== X-Received: by 2002:a63:3d8b:: with SMTP id k133mr21558561pga.413.1604497059295; Wed, 04 Nov 2020 05:37:39 -0800 (PST) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id l22sm2644198pff.27.2020.11.04.05.37.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2020 05:37:38 -0800 (PST) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Wed, 4 Nov 2020 21:37:26 +0800 Message-Id: <1604497047-30429-5-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1604497047-30429-1-git-send-email-lance.lmwang@gmail.com> References: <1604497047-30429-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH 5/6] avformat/rtsp: check return value of ffurl_read_complete 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: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang Signed-off-by: Limin Wang --- libavformat/rtsp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 3a1afa0..fc32e97 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1228,7 +1228,8 @@ start: content = av_malloc(content_length + 1); if (!content) return AVERROR(ENOMEM); - ffurl_read_complete(rt->rtsp_hd, content, content_length); + if (ffurl_read_complete(rt->rtsp_hd, content, content_length) != content_length) + return AVERROR(EIO); content[content_length] = '\0'; } if (content_ptr) From patchwork Wed Nov 4 13:37:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 23392 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 D1D6C449C3C for ; Wed, 4 Nov 2020 15:37:49 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BAAB068B32D; Wed, 4 Nov 2020 15:37:49 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C9BD968B588 for ; Wed, 4 Nov 2020 15:37:42 +0200 (EET) Received: by mail-pl1-f177.google.com with SMTP id u2so4357946pls.10 for ; Wed, 04 Nov 2020 05:37:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=c3zMXA1tGsoZl0iObBwgVqZw7Xh55m7Zx5xgN8EWKFk=; b=WJMadFtfT10plGC3Yy3KQBke+P+lVO1IwCZXRDlPK2c8jtoBTewzz96/it836chyrA 1/g5gC0qrZ78IoV1HdsxHwgxUjJ6s4giBQWy/wbZgyRmKVoxQ8Jt+YibuIV/xmzm342m xur0rL1q3Rfi/ci7BxHDmjmVqnLOpL4PKAxcWDVoqRa0Le/xcWXQugqdOS3WWsmqxm1E /3R6FAkPf2q/BALcbuOWM/1JdXBpLSqRnQRORfcAcIo+hboTzmmxKI7HHALFxdiweYmN /rrgLmHQsEtPeR2oSP1EC3GcQc4slwma4nVz/tSUSRLeUKe8S0/qwq7LTMr/vh/0YIDO 6upA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=c3zMXA1tGsoZl0iObBwgVqZw7Xh55m7Zx5xgN8EWKFk=; b=P0yitSoxvRBge0IvAIk4fFGGQqY21lhdPFD3WtbInIixxzd29APrKwjkIG2NglD4cK Pwm317tA1PNgsTLMKUaOgQcKgAgIcAwKzRjgxnUX0J0tKiX9gKi/BgatVmnOtaU/FWKa aajLNTMf4tEEONKiUyNaszWCmxbExkjW2ubadrvajqZykZBs7sD8r5impoobzy+Va09c vuBXte+38zpWyuBizOkNrRRJd3TZt/FdS3pV2lpBVSKNia/eIR9FW7tJF1I6e6Biz4gG zcp62twJJ2Is9ApXKMp/1wi+1bSqo6wE9gFLph0N9J54Yn5KrvhS9PsOoudij7SP+bs7 uj3g== X-Gm-Message-State: AOAM5321xvKURqcIr+zyjP3tx/RC94Tfz9j6yjofzIiLBpcwBO4yTYcJ kDjWIC2i5wEhkidNPh5wqQZLUqXcs6I= X-Google-Smtp-Source: ABdhPJxZuqhwcQKrcOGXeV16PNHHhgQiSsRccH8lyywpcuOBOtgSwCepY6P2BPcISBsUIinX8rz3QQ== X-Received: by 2002:a17:902:bcc6:b029:d4:db82:4439 with SMTP id o6-20020a170902bcc6b02900d4db824439mr29581424pls.63.1604497060952; Wed, 04 Nov 2020 05:37:40 -0800 (PST) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id l22sm2644198pff.27.2020.11.04.05.37.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2020 05:37:40 -0800 (PST) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Wed, 4 Nov 2020 21:37:27 +0800 Message-Id: <1604497047-30429-6-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1604497047-30429-1-git-send-email-lance.lmwang@gmail.com> References: <1604497047-30429-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH 6/6] avformat/rtspdec: return proper error code 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: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang Signed-off-by: Limin Wang --- libavformat/rtspdec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c index 3abf34b..a4cd1f6 100644 --- a/libavformat/rtspdec.c +++ b/libavformat/rtspdec.c @@ -768,7 +768,7 @@ redo: } ret = ffurl_read_complete(rt->rtsp_hd, buf, 3); if (ret != 3) - return -1; + return AVERROR(EIO); id = buf[0]; len = AV_RB16(buf + 1); av_log(s, AV_LOG_TRACE, "id=%d len=%d\n", id, len); @@ -777,10 +777,10 @@ redo: /* get the data */ ret = ffurl_read_complete(rt->rtsp_hd, buf, len); if (ret != len) - return -1; + return AVERROR(EIO); if (rt->transport == RTSP_TRANSPORT_RDT && - ff_rdt_parse_header(buf, len, &id, NULL, NULL, NULL, NULL) < 0) - return -1; + (ret = ff_rdt_parse_header(buf, len, &id, NULL, NULL, NULL, NULL)) < 0) + return ret; /* find the matching stream */ for (i = 0; i < rt->nb_rtsp_streams; i++) {