diff au.c @ 6067:51ae348d4511 libavformat

Prevent au_read_packet() looping endlessly when .au file contains unsupported codec type.
author pross
date Mon, 31 May 2010 10:47:36 +0000
parents 536e5527c1e0
children 4aaed59641ff
line wrap: on
line diff
--- a/au.c	Fri May 28 18:21:57 2010 +0000
+++ b/au.c	Mon May 31 10:47:36 2010 +0000
@@ -139,6 +139,11 @@
 
     codec = ff_codec_get_id(codec_au_tags, id);
 
+    if (!av_get_bits_per_sample(codec)) {
+        av_log_ask_for_sample(s, "could not determine bits per sample\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     if (size >= 24) {
         /* skip unused data */
         url_fseek(pb, size - 24, SEEK_CUR);