OSDN Git Service
(root)
/
coroid
/
libav_saccubus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7f84055
)
wav: make sure neither data_size nor sample_count is negative.
author
Tomas Härdin
<tomas.hardin@codemill.se>
Tue, 17 May 2011 17:52:36 +0000
(19:52 +0200)
committer
Anton Khirnov
<anton@khirnov.net>
Wed, 13 Jul 2011 09:57:51 +0000
(11:57 +0200)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavformat/wav.c
patch
|
blob
|
history
diff --git
a/libavformat/wav.c
b/libavformat/wav.c
index
3e4e0c4
..
9f902be
100644
(file)
--- a/
libavformat/wav.c
+++ b/
libavformat/wav.c
@@
-318,6
+318,12
@@
static int wav_read_header(AVFormatContext *s,
avio_rl64(pb); /* RIFF size */
data_size = avio_rl64(pb);
sample_count = avio_rl64(pb);
+ if (data_size < 0 || sample_count < 0) {
+ av_log(s, AV_LOG_ERROR, "negative data_size and/or sample_count in "
+ "ds64: data_size = %"PRId64", sample_count = %"PRId64"\n",
+ data_size, sample_count);
+ return AVERROR_INVALIDDATA;
+ }
avio_skip(pb, size - 16); /* skip rest of ds64 chunk */
}