Derek Buitenhuis | 22 Jul 2012 22:01
Picon
Gravatar

[PATCH] wav: Add check for in SMV code for fmt tag

If there is a 'SMV0' tag, but no 'fmt' tag, it is possible that
'st' got used as NULL.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis <at> gmail.com>
---
 libavformat/wav.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/wav.c b/libavformat/wav.c
index c408623..928f82d 100644
--- a/libavformat/wav.c
+++ b/libavformat/wav.c
 <at>  <at>  -480,6 +480,10  <at>  <at>  static int wav_read_header(AVFormatContext *s)
                 return ret;
             break;
         case MKTAG('S','M','V','0'):
+            if (!got_fmt) {
+                av_log(s, AV_LOG_ERROR, "found no 'fmt ' tag before the 'SMV0' tag\n");
+                return AVERROR_INVALIDDATA;
+            }
             // SMV file, a wav file with video appended.
             if (size != MKTAG('0','2','0','0')) {
                 av_log(s, AV_LOG_ERROR, "Unknown SMV version found\n");
--

-- 
1.7.10.4
Derek Buitenhuis | 22 Jul 2012 22:03
Picon
Gravatar

Re: [PATCH] wav: Add check for in SMV code for fmt tag

On 22/07/2012 4:01 PM, Derek Buitenhuis wrote:
> If there is a 'SMV0' tag, but no 'fmt' tag, it is possible that
> 'st' got used as NULL.
> 
> Signed-off-by: Derek Buitenhuis <derek.buitenhuis <at> gmail.com>
> ---
>  libavformat/wav.c |    4 ++++
>  1 file changed, 4 insertions(+)

Uh, brainfart in the commit name. Changed locally to:

wav: Add check for 'fmt' tag in SMV code

- Derek
Paul B Mahol | 22 Jul 2012 22:52
Picon
Gravatar

Re: [PATCH] wav: Add check for in SMV code for fmt tag

On 7/22/12, Derek Buitenhuis <derek.buitenhuis <at> gmail.com> wrote:
> On 22/07/2012 4:01 PM, Derek Buitenhuis wrote:
>> If there is a 'SMV0' tag, but no 'fmt' tag, it is possible that
>> 'st' got used as NULL.
>>
>> Signed-off-by: Derek Buitenhuis <derek.buitenhuis <at> gmail.com>
>> ---
>>  libavformat/wav.c |    4 ++++
>>  1 file changed, 4 insertions(+)
>
> Uh, brainfart in the commit name. Changed locally to:
>
> wav: Add check for 'fmt' tag in SMV code

lgtm. video playback for smv is broken anyway.

Gmane