aboutsummaryrefslogtreecommitdiff
path: root/gst-libs/ext/libav/libavformat/xwma.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst-libs/ext/libav/libavformat/xwma.c')
-rw-r--r--gst-libs/ext/libav/libavformat/xwma.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gst-libs/ext/libav/libavformat/xwma.c b/gst-libs/ext/libav/libavformat/xwma.c
index 5839bdc..94abfc7 100644
--- a/gst-libs/ext/libav/libavformat/xwma.c
+++ b/gst-libs/ext/libav/libavformat/xwma.c
@@ -115,6 +115,17 @@ static int xwma_read_header(AVFormatContext *s, AVFormatParameters *ap)
}
}
+ 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);