[FFmpeg-cvslog] wav: Add check for 'fmt' tag in SMV code

Derek Buitenhuis git at videolan.org
Mon Jul 23 00:04:32 CEST 2012


ffmpeg | branch: master | Derek Buitenhuis <derek.buitenhuis at gmail.com> | Mon Jul 16 14:17:52 2012 -0400| [5ab855777de94ba616a9c42fbd0f2947f95deb89] | committer: 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: Derek Buitenhuis <derek.buitenhuis at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5ab855777de94ba616a9c42fbd0f2947f95deb89
---

 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
@@ -480,6 +480,10 @@ 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");



More information about the ffmpeg-cvslog mailing list