]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/au.c
Binary text decoder
[ffmpeg] / libavformat / au.c
index 870f46f65da60c2b1ba9626c04241b302453a282..477bcdb67f3914fae0cfa195bb33f469b84584e2 100644 (file)
@@ -134,7 +134,7 @@ static int au_read_header(AVFormatContext *s,
     size = avio_rb32(pb); /* header size */
     data_size = avio_rb32(pb); /* data size in bytes */
 
-    if (data_size < 0) {
+    if (data_size < 0 && data_size != AU_UNKNOWN_SIZE) {
         av_log(s, AV_LOG_ERROR, "Invalid negative data size '%d' found\n", data_size);
         return AVERROR_INVALIDDATA;
     }
@@ -164,6 +164,7 @@ static int au_read_header(AVFormatContext *s,
     st->codec->codec_id = codec;
     st->codec->channels = channels;
     st->codec->sample_rate = rate;
+    if (data_size != AU_UNKNOWN_SIZE)
     st->duration = (((int64_t)data_size)<<3) / (st->codec->channels * bps);
     av_set_pts_info(st, 64, 1, rate);
     return 0;