From patchwork Fri Sep 30 09:29:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 790 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.66 with SMTP id o63csp123902vsd; Fri, 30 Sep 2016 02:29:33 -0700 (PDT) X-Received: by 10.194.85.18 with SMTP id d18mr5791390wjz.43.1475227773881; Fri, 30 Sep 2016 02:29:33 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id t133si3708917wmg.107.2016.09.30.02.29.33; Fri, 30 Sep 2016 02:29:33 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 959EE689F85; Fri, 30 Sep 2016 12:29:18 +0300 (EEST) 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 2930B689AF0 for ; Fri, 30 Sep 2016 12:29:12 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 116C3100CEF; Fri, 30 Sep 2016 11:29:25 +0200 (CEST) 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 c-DijVURyWqb; Fri, 30 Sep 2016 11:29:23 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 6FE72100B9D; Fri, 30 Sep 2016 11:29:23 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Fri, 30 Sep 2016 11:29:05 +0200 Message-Id: <1475227747-11938-1-git-send-email-cus@passwd.hu> X-Mailer: git-send-email 2.6.6 Subject: [FFmpeg-devel] [PATCH 1/3] lavc/utils: disallow zero sized packets with data set in avcodec_send_packet 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 --- libavcodec/utils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index cf85300..d0a6817 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -2813,6 +2813,9 @@ int attribute_align_arg avcodec_send_packet(AVCodecContext *avctx, const AVPacke if (avctx->internal->draining) return AVERROR_EOF; + if (avpkt && !avpkt->size && avpkt->data) + return AVERROR(EINVAL); + if (!avpkt || !avpkt->size) { avctx->internal->draining = 1; avpkt = NULL;