]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/pcmdec.c
rtmpproto: Check the buffer sizes when copying app/playpath strings
[ffmpeg] / libavformat / pcmdec.c
index 716d8b7977f024af922a1a0f232b5dd9104c0120..1bbbc66d176e1fa19c7b7c3cbe2b15dda2d916c2 100644 (file)
@@ -74,7 +74,11 @@ static int pcm_read_packet(AVFormatContext *s, AVPacket *pkt)
         return ret;
 
     bps= av_get_bits_per_sample(s->streams[0]->codec->codec_id);
-    assert(bps); // if false there IS a bug elsewhere (NOT in this function)
+    if (!bps) {
+        av_log(s, AV_LOG_ERROR, "Unknown number of bytes per sample.\n");
+        return AVERROR(EINVAL);
+    }
+
     pkt->dts=
     pkt->pts= pkt->pos*8 / (bps * s->streams[0]->codec->channels);