Message ID | HE1PR0301MB21542C65A14514A064CFC6E78F309@HE1PR0301MB2154.eurprd03.prod.outlook.com |
---|---|
State | Accepted |
Commit | 87319ed26fee13c4ad45a1cdc0d4866c7a73f320 |
Headers | show
Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5e:c91a:0:0:0:0:0 with SMTP id z26csp4311802iol; Tue, 15 Jun 2021 16:35:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbSWtkf3+iD+c53VQhw0ewzmjK7rbS2r0ezMcKJcH4p6p6moq3Dp2JkMF9ND9gteKbLUeM X-Received: by 2002:a17:906:480a:: with SMTP id w10mr2084854ejq.18.1623800142181; Tue, 15 Jun 2021 16:35:42 -0700 (PDT) Return-Path: <ffmpeg-devel-bounces@ffmpeg.org> Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id bt10si423038ejb.390.2021.06.15.16.35.41; Tue, 15 Jun 2021 16:35:42 -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; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=pdNRectc; arc=fail (body hash mismatch); 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F1261689B7F; Wed, 16 Jun 2021 02:33:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2095.outbound.protection.outlook.com [40.92.90.95]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2D8D6689A12 for <ffmpeg-devel@ffmpeg.org>; Wed, 16 Jun 2021 02:33:26 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GFCT19gUeI9uwJCu4OSqDs5FpXgPL0mwcy+zz4EoxzpqxMKq8O47XpliV0hSJt4wwfNdXpQfQl7HoTT11ZoTtyamTHHaYXWVyJqkWZErNbcYXteyG4rgaMR45aPejnHkbo79DG+or2QCtMjTKyEYQHPMd5+WOe27WOddwEnSPQXK+IDf1mMnBU5nYIO8vv+JKDKa1zqJfAFvtKbF2IbIuQHqcMNRfV95N/sBtGp/4qLzGarwCWX8mVXYxmtEhUMFLmijFbLQTqX9Oou3wZRk7T5R48osj6uwGJfH23Zp7j1wL9ogfILvWoWZvluTa6YBd8G/KdqJrK6KZ3SyYpPvGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K5+J7wUB/sTVC5LHmahdKlTw8TIVsUEAcYWytyIlB7k=; b=Ai9n+XzkaUKyyGertRL1nP8DSBTQ40rNclMqhP5/eJjo9mBdjSCCco6UR44CLuHJyHLiJtoWru83KMgntu7aZzknpIOx29XpCCfUi150skpE6y1UuMuL72P3SoyWbfMgSXbtd9LvF5pS9c7TmeggxC7j70sr+Z/X/ltOD8KuPBviQmBp77JjXpiIpatJCcIAPKavaGQt2w9Hi6I4mj+9hVzVtqJZSIhntGRCgnl+TkL6ux2fwxZh2CkVSntjpmzFErAQ83RDC1uiv3Eb7DkKn0VrM2KEegYkBwool/aeqGIjq1Kap9b0eObkpPJSv+CT5PteaepIwD1jHvwpEkM7mg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K5+J7wUB/sTVC5LHmahdKlTw8TIVsUEAcYWytyIlB7k=; b=pdNRectc3ZZCButwZhp7JNT/GxBhmxlCbPDoqN6JG6GajXPg91NRMd0siQIQBkgKg2Ho0KaZZjkVBSzuEC6B9k8FzfkUYbZQdHDCtNuu5PUITjG8EfKvqurp0RL5TyDGby5zKQ/oxbPoR+ov+p1DN/AQi/MHdJJnuKcFwMRr7h9TmuI/PdQjJv6DMy7LTO8JzCe74Tyt55MSS0ysZ12eAh2eun2L69ee7BhWSNiCb7AmDNs2LNX1PTQGEzDDXT7bC9xrKWzrfSfGSPeDqPEHKRB4zIrR8wYABs+fHlCAXKKJcqONxBEy7zVkdt9I9eF4H7FKD6Nh6ptW3Z6JXyixFA== Received: from DB8EUR05FT045.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc0f::51) by DB8EUR05HT149.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc0f::112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21; Tue, 15 Jun 2021 23:33:25 +0000 Received: from HE1PR0301MB2154.eurprd03.prod.outlook.com (2a01:111:e400:fc0f::46) by DB8EUR05FT045.mail.protection.outlook.com (2a01:111:e400:fc0f::383) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.16 via Frontend Transport; Tue, 15 Jun 2021 23:33:25 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:291AB54EC00EFD97200D1615345C47E986A13D799A7B4CA686CAE135C568EF8D; UpperCasedChecksum:94296D7D7DBF0228B6EA206C240D5E475359506F45BA2270680225D0DFCAF5FA; SizeAsReceived:7584; Count:48 Received: from HE1PR0301MB2154.eurprd03.prod.outlook.com ([fe80::f4cc:63fc:9cef:37fb]) by HE1PR0301MB2154.eurprd03.prod.outlook.com ([fe80::f4cc:63fc:9cef:37fb%6]) with mapi id 15.20.4219.025; Tue, 15 Jun 2021 23:33:25 +0000 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Date: Wed, 16 Jun 2021 01:32:07 +0200 Message-ID: <HE1PR0301MB21542C65A14514A064CFC6E78F309@HE1PR0301MB2154.eurprd03.prod.outlook.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <HE1PR0301MB21549E6468C815E64544E2958F309@HE1PR0301MB2154.eurprd03.prod.outlook.com> References: <HE1PR0301MB21549E6468C815E64544E2958F309@HE1PR0301MB2154.eurprd03.prod.outlook.com> X-TMN: [6FR1/+MMkyUn4ivNACkhJQfzfhdy/+r/] X-ClientProxiedBy: PR3P189CA0063.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:b4::8) To HE1PR0301MB2154.eurprd03.prod.outlook.com (2603:10a6:3:2a::22) X-Microsoft-Original-Message-ID: <20210615233243.1173928-17-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.97.82) by PR3P189CA0063.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:b4::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Tue, 15 Jun 2021 23:33:24 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: ce36c78c-cf4d-4a5a-7379-08d93055f89f X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiR9SlwCHtPrt+MV8TUUwp4pQ3gFot+Jrk9mLI+N6jfyjJigjcIXI0Db5zo2BIfQfrEzmuUKuMn/j18CKfRWtm2d9C/j8C0e1yVI3jm8DynQEQ6/MnwpeRmmZfb5J+ojpwdGeASK9BpSU3Fyj2EPoLLti01pgHAl4CPylgAZuIQ0nXhZT5QrgL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MS-Exchange-AntiSpam-MessageData: 9SE3Tk9UX18NidzUyaKVXBnK5SgQ4CkGEohLrw207RwIVsY37LVvYnH7hz6W4W+3WMkXaRUQ7peHsDYu1/a1FDBTdEHojA93b/K2QPrWoroekPCa3EujT0c+2zPWT9sZ25qeyg0ngVvLXgN4K+/rbQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce36c78c-cf4d-4a5a-7379-08d93055f89f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2021 23:33:25.3617 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DB8EUR05FT045.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8EUR05HT149 Subject: [FFmpeg-devel] [PATCH 18/54] avformat/libgme: Simplify cleanup after read_header failure X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org> List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe> List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel> List-Post: <mailto:ffmpeg-devel@ffmpeg.org> List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help> List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe> Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org> X-TUID: c4pDqM4Vu012 |
Series |
[FFmpeg-devel,01/54] avformat: Add internal flags for AV(In|Out)putFormat
|
expand
|
Context | Check | Description |
---|---|---|
andriy/x86_make | success | Make finished |
andriy/x86_make_fate | success | Make fate finished |
andriy/PPC64_make | success | Make finished |
andriy/PPC64_make_fate | success | Make fate finished |
diff --git a/libavformat/libgme.c b/libavformat/libgme.c index 95323002e6..6a145349a7 100644 --- a/libavformat/libgme.c +++ b/libavformat/libgme.c @@ -84,7 +84,8 @@ static int load_metadata(AVFormatContext *s, int64_t *duration) static int read_close_gme(AVFormatContext *s) { GMEContext *gme = s->priv_data; - gme_delete(gme->music_emu); + if (gme->music_emu) + gme_delete(gme->music_emu); return 0; } @@ -121,26 +122,21 @@ static int read_header_gme(AVFormatContext *s) } if (gme_open_data(buf, sz, &gme->music_emu, gme->sample_rate)) { + gme->music_emu = NULL; /* Just for safety */ av_freep(&buf); return AVERROR_INVALIDDATA; } av_freep(&buf); ret = load_metadata(s, &duration); - if (ret < 0) { - read_close_gme(s); + if (ret < 0) return ret; - } - if (gme_start_track(gme->music_emu, gme->track_index)) { - read_close_gme(s); + if (gme_start_track(gme->music_emu, gme->track_index)) return AVERROR_UNKNOWN; - } st = avformat_new_stream(s, NULL); - if (!st) { - read_close_gme(s); + if (!st) return AVERROR(ENOMEM); - } avpriv_set_pts_info(st, 64, 1, 1000); if (duration > 0) st->duration = duration; @@ -201,6 +197,7 @@ const AVInputFormat ff_libgme_demuxer = { .name = "libgme", .long_name = NULL_IF_CONFIG_SMALL("Game Music Emu demuxer"), .priv_data_size = sizeof(GMEContext), + .flags_internal = FF_FMT_INIT_CLEANUP, .read_probe = probe_gme, .read_header = read_header_gme, .read_packet = read_packet_gme,
by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavformat/libgme.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)