projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
86f2ae0
)
xwma: Validate channels and bits_per_coded_sample.
author
Alex Converse
<alex.converse@gmail.com>
Wed, 21 Mar 2012 17:58:07 +0000
(10:58 -0700)
committer
Alex Converse
<alex.converse@gmail.com>
Thu, 22 Mar 2012 20:57:12 +0000
(13:57 -0700)
This prevents a SIGFPE later on.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
libavformat/xwma.c
patch
|
blob
|
history
diff --git
a/libavformat/xwma.c
b/libavformat/xwma.c
index 2c6ee114bd8f383518077079c54e49fecd7a7563..7b34b96433c4b216e513a61bb7b85d79e3fb03ad 100644
(file)
--- a/
libavformat/xwma.c
+++ b/
libavformat/xwma.c
@@
-115,6
+115,17
@@
static int xwma_read_header(AVFormatContext *s)
}
}
+ if (!st->codec->channels) {
+ av_log(s, AV_LOG_WARNING, "Invalid channel count: %d\n",
+ st->codec->channels);
+ return AVERROR_INVALIDDATA;
+ }
+ if (!st->codec->bits_per_coded_sample) {
+ av_log(s, AV_LOG_WARNING, "Invalid bits_per_coded_sample: %d\n",
+ st->codec->bits_per_coded_sample);
+ return AVERROR_INVALIDDATA;
+ }
+
/* set the sample rate */
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);