From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id ED86E42099 for ; Tue, 22 Feb 2022 08:09:32 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2D33568B022; Tue, 22 Feb 2022 10:09:30 +0200 (EET) Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 66203680BC7 for ; Tue, 22 Feb 2022 10:09:24 +0200 (EET) Received: by mail-yb1-f169.google.com with SMTP id p19so39361106ybc.6 for ; Tue, 22 Feb 2022 00:09:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Rg7L9S5461H1GzEVXJxh5yEXye1W/+P7kbd24/mqLXc=; b=jEmT4WCC/6wB3366NnPZTAS+MbOAeFQqwiUZoKxghpD/aO/UFlTt3BtPm+Bku9tgkI 5uZwKUcyHoB5E/0Kh2BdbIEmQ8bxlIvYPzpEAZ6nYB11rWMpjRDKL94+kE5023MStJFN ofsMDGA7l4q68t8bmhk53Xsg2/lcg8b/KUX7XECJ5BK7tpQVsucgtYeZE9vh9MsanC8w 6mKKrpfFuw/pZ6VF3LTUCR4576ZbM+i0VysbvKx9BjQQGy1muQQ1PAF7gxLCXQvMwarg QW/Q9Zrdtff5EU7qCKCx2WmJTOhaEOXUOnyzckYXMAdx7kiwQF9CPecREuefJ8/NXwNC JZDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Rg7L9S5461H1GzEVXJxh5yEXye1W/+P7kbd24/mqLXc=; b=xGIe8mIzg737iCWLqyY6vNvWjkdQ/Ri1p6b/sXNPuxQQ4DdSq4YbhVEw/gCJHNPqot HKoVoQKiMdwIizrDXiSTOYM2ugTCUqFlDzz1tj9vq9ilATVMalJoIrMJPLiykx9tij3A YWY/yP+09oxpJE/01/QQhEJC1NR4A2v7xSPzb61sukCX3p/9XWc5XDyqnTrwF+QGNQ4T s258IAmFwgXcIjrs8/nhQD5iAavMyWGlPr+s6koTwSun2FYHc6cxDemZqXvDjtf2EhJF kSHsvx4HONh5vBkVUxESdMYCqtRBkRgWHGLyrSGFdd6CKROk20nSH/eiKec74BpESAqQ RyFQ== X-Gm-Message-State: AOAM530c3lAbBcCbXas3EDbrHaiOfwo25Itxty8rvC2IESMSkCRS5U6c Jkib3M/GzG1GwTcl7czJOqed8lKH/L7Y6a3fNjaL/99MSlQ= X-Google-Smtp-Source: ABdhPJwv7dEe85KeaslYcmjWs7pcpvd0yqxEl8vxHhaOQILn1pvBv4FYuVP2bgFiCMcxzsSeUO0sFlErvno0fpKRFZk= X-Received: by 2002:a25:d949:0:b0:611:af1f:71e0 with SMTP id q70-20020a25d949000000b00611af1f71e0mr21900876ybg.396.1645517362827; Tue, 22 Feb 2022 00:09:22 -0800 (PST) MIME-Version: 1.0 References: <20220222074953.2788880-1-jiasheng@iscas.ac.cn> In-Reply-To: <20220222074953.2788880-1-jiasheng@iscas.ac.cn> From: Paul B Mahol Date: Tue, 22 Feb 2022 09:10:51 +0100 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH] avformat: Add check for ff_get_extradata X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: Jiasheng Jiang Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Tue, Feb 22, 2022 at 8:50 AM Jiasheng Jiang wrote: > As the potential failure of the memory allocation, the ff_get_extradata() > could return error if fails. > Therefore, it should be better to deal with the return value of the > ff_get_extradata() and return error if fails. > Not really necessary. Does not fix anything. > > Fixes: 2d720069a9 ("avformat: add aix demuxer") > Signed-off-by: Jiasheng Jiang > --- > libavformat/aixdec.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/libavformat/aixdec.c b/libavformat/aixdec.c > index 59c3d60da3..89f73b6913 100644 > --- a/libavformat/aixdec.c > +++ b/libavformat/aixdec.c > @@ -40,7 +40,7 @@ static int aix_read_header(AVFormatContext *s) > unsigned segment_list_offset = 0x20; > unsigned segment_list_entry_size = 0x10; > unsigned size; > - int i; > + int i, ret; > > avio_skip(s->pb, 4); > first_offset = avio_rb32(s->pb) + 8; > @@ -77,7 +77,9 @@ static int aix_read_header(AVFormatContext *s) > if (size <= 8) > return AVERROR_INVALIDDATA; > avio_skip(s->pb, 8); > - ff_get_extradata(s, s->streams[i]->codecpar, s->pb, size - 8); > + ret = ff_get_extradata(s, s->streams[i]->codecpar, s->pb, size - > 8); > + if (ret < 0) > + return ret; > } > > return 0; > -- > 2.25.1 > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".