]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/westwood_aud.c
lavf/avio: Be more explicit in logging white/black list matches
[ffmpeg] / libavformat / westwood_aud.c
index 4750167f136a2e890c84c3f32769f7aec2a035be..9c2d35cb8a30456bb8c911cfcc1c7489549241c1 100644 (file)
@@ -164,6 +164,12 @@ static int wsaud_read_packet(AVFormatContext *s,
         if (ret != chunk_size)
             return AVERROR(EIO);
 
+        if (st->codecpar->channels <= 0) {
+            av_log(s, AV_LOG_ERROR, "invalid number of channels %d\n",
+                   st->codecpar->channels);
+            return AVERROR_INVALIDDATA;
+        }
+
         /* 2 samples/byte, 1 or 2 samples per frame depending on stereo */
         pkt->duration = (chunk_size * 2) / st->codecpar->channels;
     }