diff mbox

[FFmpeg-devel,4/9] ircamdec: prevent overflow during block alignment calculation

Message ID 88207ab8-0e14-823a-46d9-f7cf899f7d89@googlemail.com
State Accepted
Headers show

Commit Message

Andreas Cadhalpun Jan. 30, 2017, 12:42 a.m. UTC
On 29.01.2017 02:34, Michael Niedermayer wrote:
> On Thu, Jan 26, 2017 at 02:12:19AM +0100, Andreas Cadhalpun wrote:
>> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
>> ---
>>  libavformat/ircamdec.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
> 
> LGTM assuming the author/maintainer does not object, maybe he
> prefers this without the log message

Attached is a variant without the log message.

Best regards,
Andreas

Comments

Paul B Mahol Jan. 30, 2017, 8:52 a.m. UTC | #1
On 1/30/17, Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> wrote:
> On 29.01.2017 02:34, Michael Niedermayer wrote:
>> On Thu, Jan 26, 2017 at 02:12:19AM +0100, Andreas Cadhalpun wrote:
>>> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
>>> ---
>>>  libavformat/ircamdec.c | 6 ++++++
>>>  1 file changed, 6 insertions(+)
>>
>> LGTM assuming the author/maintainer does not object, maybe he
>> prefers this without the log message
>
> Attached is a variant without the log message.
>

ok
Andreas Cadhalpun Jan. 31, 2017, 1:14 a.m. UTC | #2
On 30.01.2017 09:52, Paul B Mahol wrote:
> On 1/30/17, Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> wrote:
>> On 29.01.2017 02:34, Michael Niedermayer wrote:
>>> On Thu, Jan 26, 2017 at 02:12:19AM +0100, Andreas Cadhalpun wrote:
>>>> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
>>>> ---
>>>>  libavformat/ircamdec.c | 6 ++++++
>>>>  1 file changed, 6 insertions(+)
>>>
>>> LGTM assuming the author/maintainer does not object, maybe he
>>> prefers this without the log message
>>
>> Attached is a variant without the log message.
>>
> 
> ok

Pushed.

Best regards,
Andreas
diff mbox

Patch

From bf03bedf16ee4659defdca1b82eb213448d00f59 Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Date: Thu, 15 Dec 2016 02:14:45 +0100
Subject: [PATCH] ircamdec: prevent overflow during block alignment calculation

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
---
 libavformat/ircamdec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/ircamdec.c b/libavformat/ircamdec.c
index 59f3a49411..a6b7a280f3 100644
--- a/libavformat/ircamdec.c
+++ b/libavformat/ircamdec.c
@@ -20,6 +20,7 @@ 
  */
 
 #include "libavutil/intreadwrite.h"
+#include "libavcodec/internal.h"
 #include "avformat.h"
 #include "internal.h"
 #include "pcm.h"
@@ -87,6 +88,8 @@  static int ircam_read_header(AVFormatContext *s)
 
     st->codecpar->codec_type  = AVMEDIA_TYPE_AUDIO;
     st->codecpar->channels    = channels;
+    if (st->codecpar->channels > FF_SANE_NB_CHANNELS)
+        return AVERROR(ENOSYS);
     st->codecpar->sample_rate = sample_rate;
 
     st->codecpar->codec_id = ff_codec_get_id(tags, tag);
-- 
2.11.0