]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/pmpdec.c
http: Reduce scope of a variable in parse_content_encoding()
[ffmpeg] / libavformat / pmpdec.c
index 6cdce107c4658d9471203681db9249d4a131a469..8ae147f3919a1b02b6f606bd2e39c4b40d1e0168 100644 (file)
@@ -124,6 +124,11 @@ static int pmp_packet(AVFormatContext *s, AVPacket *pkt)
     if (pmp->cur_stream == 0) {
         int num_packets;
         pmp->audio_packets = avio_r8(pb);
+        if (!pmp->audio_packets) {
+            av_log(s, AV_LOG_ERROR, "No audio packets.\n");
+            return AVERROR_INVALIDDATA;
+        }
+
         num_packets = (pmp->num_streams - 1) * pmp->audio_packets + 1;
         avio_skip(pb, 8);
         pmp->current_packet = 0;
@@ -157,7 +162,7 @@ static int pmp_seek(AVFormatContext *s, int stream_idx, int64_t ts, int flags)
 {
     PMPContext *pmp = s->priv_data;
     pmp->cur_stream = 0;
-    // fallback to default seek now
+    // fall back on default seek now
     return -1;
 }