summaryrefslogtreecommitdiff
path: root/libavformat/xwma.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-22 23:16:49 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-03-22 23:16:49 +0100
commit464cef4c14a6a550ee30810416d18686b5f3ffa0 (patch)
tree906af3c9685883fb966b8d95f2e416e68b9fee36 /libavformat/xwma.c
parent9759d2b886057b90355716edb23262e17f9bc3f9 (diff)
parent5023b89bba198b2f8e43b7f555aeb9c30d33db9f (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: xwma: Validate channels and bits_per_coded_sample. mov: Do not read past the end of the ctts_data table. mov: Add missing terminator to mov_ch_layout_map_1ch. asf: reset side data elements on packet copy. wmavoice: fix stack overread. wmalossless: error out if a subframe is not used by any channel. vqa: check palette chunk size before reading data. wmalossless: reset sample pointer for each subframe. wmalossless: error out on invalid values for order. Conflicts: libavcodec/vqavideo.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/xwma.c')
-rw-r--r--libavformat/xwma.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavformat/xwma.c b/libavformat/xwma.c
index ea7cc4f36e..bd3af35b72 100644
--- 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);