From patchwork Thu Oct 10 05:48:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Steven X-Patchwork-Id: 15667 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 94EF3448DAE for ; Thu, 10 Oct 2019 08:48:33 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 72BFC688094; Thu, 10 Oct 2019 08:48:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbgeu1.qq.com (smtpbgeu1.qq.com [52.59.177.22]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6150D687F73 for ; Thu, 10 Oct 2019 08:48:26 +0300 (EEST) X-QQ-mid: bizesmtp11t1570686499tcar205j Received: from localhost (unknown [47.90.47.25]) by esmtp6.qq.com (ESMTP) with id ; Thu, 10 Oct 2019 13:48:19 +0800 (CST) X-QQ-SSF: 01100000002000K0ZRF1000A0000000 X-QQ-FEAT: H1NnLTI89twUdNimjandZa76tlqV6dY7tdCNM/h7l2uOndrqyiEcDY0K54oNy XjYDhueOCv+uhAnbXjiHVHK2tuYAn/sbZGmjOb6C6bqOR6BEET++lv7dIoSrqJaIW2BpiRx ra0QkVuz5R0UZEHWTdDFn/4M7VlhlxblCyGBp40qkA7G+g13fewKot5xmWYejbyURW1+PFH o/4/4Ods/X5Wb+0iyYsqLgu1TN8Uoi1CSBObO/Z0d0gX4LSpEwxUfGNSrA/VVfAdzVS/G16 tZq3mVihT/mRMHS5104rELewzfSRU0ZHfDRPvyR88sAlOjxwUQQThwmX+7kUXFcS1tmQ== X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Thu, 10 Oct 2019 13:48:17 +0800 Message-Id: <20191010054817.5038-1-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.10.1.382.ga23ca1b.dirty In-Reply-To: References: X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:chinaffmpeg.org:qybgforeign:qybgforeign4 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH v2] avformat/mtv: check av_strdup() return value 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: Steven Liu MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Steven Liu --- libavformat/mtv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/mtv.c b/libavformat/mtv.c index 728f4a4781..e731d91077 100644 --- a/libavformat/mtv.c +++ b/libavformat/mtv.c @@ -171,6 +171,8 @@ static int mtv_read_header(AVFormatContext *s) st->codecpar->width = mtv->img_width; st->codecpar->height = mtv->img_height; st->codecpar->extradata = av_strdup("BottomUp"); + if (!st->codecpar->extradata) + return AVERROR(ENOMEM); st->codecpar->extradata_size = 9; // audio - mp3