]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/voc_packet.c
mov: Fix spherical metadata_source parsing
[ffmpeg] / libavformat / voc_packet.c
index 5833a79b56495ca24c5510e40aa041fef3c25a82..4f60467ac41e20dc9ff9bf651c9a988794872ae5 100644 (file)
@@ -106,6 +106,11 @@ ff_voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
         }
     }
 
+    if (par->sample_rate <= 0) {
+        av_log(s, AV_LOG_ERROR, "Invalid sample rate %d\n", par->sample_rate);
+        return AVERROR_INVALIDDATA;
+    }
+
     if (tmp_codec >= 0) {
         tmp_codec = ff_codec_get_id(ff_voc_codec_tags, tmp_codec);
         if (par->codec_id == AV_CODEC_ID_NONE)
@@ -121,7 +126,7 @@ ff_voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
         }
     }
 
-    par->bit_rate = par->sample_rate * par->channels * par->bits_per_coded_sample;
+    par->bit_rate = (int64_t)par->sample_rate * par->channels * par->bits_per_coded_sample;
 
     if (max_size <= 0)
         max_size = 2048;