X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fxwma.c;h=bd3af35b728f8a63e40883e35d87537784463c19;hb=b7ce3242f8000ad497a17c3288a59aa508cef31c;hp=a4e53fa2d212f27b553f4bdddd1b31b0daa7bc4f;hpb=794006f8fe403ccd2993513a8e4fbe885ef7f9fb;p=ffmpeg diff --git a/libavformat/xwma.c b/libavformat/xwma.c index a4e53fa2d21..bd3af35b728 100644 --- a/libavformat/xwma.c +++ b/libavformat/xwma.c @@ -40,7 +40,7 @@ static int xwma_probe(AVProbeData *p) return 0; } -static int xwma_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int xwma_read_header(AVFormatContext *s) { int64_t size, av_uninit(data_size); int ret; @@ -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);