diff mbox

[FFmpeg-devel,8/9] xvag: prevent overflow during block alignment calculation

Message ID 49b95490-7e34-0ec2-509b-8fdd1453b6f4@googlemail.com
State Accepted
Commit cba4f0e97ecbbde7c71ec7a7ae3eb1469b34545b
Headers show

Commit Message

Andreas Cadhalpun Jan. 26, 2017, 1:13 a.m. UTC
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
---
 libavformat/xvag.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer Jan. 29, 2017, 1:35 a.m. UTC | #1
On Thu, Jan 26, 2017 at 02:13:48AM +0100, Andreas Cadhalpun wrote:
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
> ---
>  libavformat/xvag.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

LGTM assuming the author/maintainer does not object


[...]
Paul B Mahol Jan. 29, 2017, 8:51 a.m. UTC | #2
On 1/29/17, Michael Niedermayer <michaelni@gmx.at> wrote:
> On Thu, Jan 26, 2017 at 02:13:48AM +0100, Andreas Cadhalpun wrote:
>> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
>> ---
>>  libavformat/xvag.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> LGTM assuming the author/maintainer does not object

ok
Andreas Cadhalpun Jan. 30, 2017, 12:45 a.m. UTC | #3
On 29.01.2017 09:51, Paul B Mahol wrote:
> On 1/29/17, Michael Niedermayer <michaelni@gmx.at> wrote:
>> On Thu, Jan 26, 2017 at 02:13:48AM +0100, Andreas Cadhalpun wrote:
>>> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
>>> ---
>>>  libavformat/xvag.c | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> LGTM assuming the author/maintainer does not object
> 
> ok

Pushed.

Best regards,
Andreas
diff mbox

Patch

diff --git a/libavformat/xvag.c b/libavformat/xvag.c
index 5ef4fb0900..22e4f1e3c8 100644
--- a/libavformat/xvag.c
+++ b/libavformat/xvag.c
@@ -20,6 +20,7 @@ 
  */
 
 #include "libavutil/bswap.h"
+#include "libavcodec/internal.h"
 #include "avformat.h"
 #include "internal.h"
 
@@ -68,7 +69,7 @@  static int xvag_read_header(AVFormatContext *s)
 
     if (st->codecpar->sample_rate <= 0)
         return AVERROR_INVALIDDATA;
-    if (st->codecpar->channels <= 0)
+    if (st->codecpar->channels <= 0 || st->codecpar->channels > FF_SANE_NB_CHANNELS)
         return AVERROR_INVALIDDATA;
 
     switch (codec) {