[FFmpeg-devel] lavf/latmenc: Error out for invalid codecs

Submitted by Carl Eugen Hoyos on Nov. 1, 2017, 1:17 a.m.

Details

Message ID CAB0OVGr-wB7q=GX_TENg5FaPpa0TKPOHDiGKKKVZVGJ5-Yvbhg@mail.gmail.com
State Accepted
Headers show

Commit Message

Carl Eugen Hoyos Nov. 1, 2017, 1:17 a.m.
2017-10-31 17:38 GMT+01:00 Michael Niedermayer <michael@niedermayer.cc>:
> On Mon, Oct 30, 2017 at 11:51:30PM +0100, Carl Eugen Hoyos wrote:
>> Hi!
>>
>> Attached patch makes sure the loas muxer does not try to write
>> anything but aac and latm.
>>
>> Please comment, Carl Eugen
>
>>  latmenc.c |    4 ++++
>>  1 file changed, 4 insertions(+)
>> 2b64f3d5ecb189e77b85dbab7a6cbfe9657701f2  0001-lavf-latmenc-Error-out-for-invalid-codecs.patch
>> From 9f8f39b402f77b53613a395129f96feee5e873ba Mon Sep 17 00:00:00 2001
>> From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
>> Date: Mon, 30 Oct 2017 23:49:29 +0100
>> Subject: [PATCH] lavf/latmenc: Error out for invalid codecs.
>
> isnt AV_CODEC_ID_MP4ALS supported too ? (i see ALS
> related code in latmenc.c)

New patch attached.

Thank you, Carl Eugen

Comments

Michael Niedermayer Nov. 1, 2017, 2:39 a.m.
On Wed, Nov 01, 2017 at 02:17:06AM +0100, Carl Eugen Hoyos wrote:
> 2017-10-31 17:38 GMT+01:00 Michael Niedermayer <michael@niedermayer.cc>:
> > On Mon, Oct 30, 2017 at 11:51:30PM +0100, Carl Eugen Hoyos wrote:
> >> Hi!
> >>
> >> Attached patch makes sure the loas muxer does not try to write
> >> anything but aac and latm.
> >>
> >> Please comment, Carl Eugen
> >
> >>  latmenc.c |    4 ++++
> >>  1 file changed, 4 insertions(+)
> >> 2b64f3d5ecb189e77b85dbab7a6cbfe9657701f2  0001-lavf-latmenc-Error-out-for-invalid-codecs.patch
> >> From 9f8f39b402f77b53613a395129f96feee5e873ba Mon Sep 17 00:00:00 2001
> >> From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
> >> Date: Mon, 30 Oct 2017 23:49:29 +0100
> >> Subject: [PATCH] lavf/latmenc: Error out for invalid codecs.
> >
> > isnt AV_CODEC_ID_MP4ALS supported too ? (i see ALS
> > related code in latmenc.c)
> 
> New patch attached.
> 
> Thank you, Carl Eugen

>  latmenc.c |    4 ++++
>  1 file changed, 4 insertions(+)
> c18fb099cde57aae9a9811b5ee1bf0da08cd9365  0001-lavf-latmenc-Error-out-for-unsupported-codecs.patch
> From d31193d8d2702b0c340b0b4fd2f1682f09b3035c Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
> Date: Wed, 1 Nov 2017 02:15:10 +0100
> Subject: [PATCH] lavf/latmenc: Error out for unsupported codecs.

probably ok

[...]
Carl Eugen Hoyos March 20, 2019, 11:12 p.m.
2017-11-01 3:39 GMT+01:00, Michael Niedermayer <michael@niedermayer.cc>:
> On Wed, Nov 01, 2017 at 02:17:06AM +0100, Carl Eugen Hoyos wrote:
>> 2017-10-31 17:38 GMT+01:00 Michael Niedermayer <michael@niedermayer.cc>:
>> > On Mon, Oct 30, 2017 at 11:51:30PM +0100, Carl Eugen Hoyos wrote:
>> >> Hi!
>> >>
>> >> Attached patch makes sure the loas muxer does not try to write
>> >> anything but aac and latm.
>> >>
>> >> Please comment, Carl Eugen
>> >
>> >>  latmenc.c |    4 ++++
>> >>  1 file changed, 4 insertions(+)
>> >> 2b64f3d5ecb189e77b85dbab7a6cbfe9657701f2
>> >> 0001-lavf-latmenc-Error-out-for-invalid-codecs.patch
>> >> From 9f8f39b402f77b53613a395129f96feee5e873ba Mon Sep 17 00:00:00 2001
>> >> From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
>> >> Date: Mon, 30 Oct 2017 23:49:29 +0100
>> >> Subject: [PATCH] lavf/latmenc: Error out for invalid codecs.
>> >
>> > isnt AV_CODEC_ID_MP4ALS supported too ? (i see ALS
>> > related code in latmenc.c)
>>
>> New patch attached.
>>
>> Thank you, Carl Eugen
>
>>  latmenc.c |    4 ++++
>>  1 file changed, 4 insertions(+)
>> c18fb099cde57aae9a9811b5ee1bf0da08cd9365
>> 0001-lavf-latmenc-Error-out-for-unsupported-codecs.patch
>> From d31193d8d2702b0c340b0b4fd2f1682f09b3035c Mon Sep 17 00:00:00 2001
>> From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
>> Date: Wed, 1 Nov 2017 02:15:10 +0100
>> Subject: [PATCH] lavf/latmenc: Error out for unsupported codecs.
>
> probably ok

Patch applied.

Thank you, Carl Eugen

Patch hide | download patch | download mbox

From d31193d8d2702b0c340b0b4fd2f1682f09b3035c Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Wed, 1 Nov 2017 02:15:10 +0100
Subject: [PATCH] lavf/latmenc: Error out for unsupported codecs.

---
 libavformat/latmenc.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/latmenc.c b/libavformat/latmenc.c
index 273197b..3b2d7af 100644
--- a/libavformat/latmenc.c
+++ b/libavformat/latmenc.c
@@ -89,6 +89,10 @@  static int latm_write_header(AVFormatContext *s)
 
     if (par->codec_id == AV_CODEC_ID_AAC_LATM)
         return 0;
+    if (par->codec_id != AV_CODEC_ID_AAC && par->codec_id != AV_CODEC_ID_MP4ALS) {
+        av_log(ctx, AV_LOG_ERROR, "Only AAC, LATM and ALS are supported\n");
+        return AVERROR_INVALIDDATA;
+    }
 
     if (par->extradata_size > 0 &&
         latm_decode_extradata(ctx, par->extradata, par->extradata_size) < 0)
-- 
1.7.10.4