Commit 5ab85577 authored by Derek Buitenhuis's avatar Derek Buitenhuis

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

If there is a 'SMV0' tag, but no 'fmt' tag, it is possible that
'st' got used as NULL.
Signed-off-by: 's avatarDerek Buitenhuis <derek.buitenhuis@gmail.com>
parent 4f4eb380
...@@ -480,6 +480,10 @@ static int wav_read_header(AVFormatContext *s) ...@@ -480,6 +480,10 @@ static int wav_read_header(AVFormatContext *s)
return ret; return ret;
break; break;
case MKTAG('S','M','V','0'): 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. // SMV file, a wav file with video appended.
if (size != MKTAG('0','2','0','0')) { if (size != MKTAG('0','2','0','0')) {
av_log(s, AV_LOG_ERROR, "Unknown SMV version found\n"); av_log(s, AV_LOG_ERROR, "Unknown SMV version found\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment