changeset 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 490c440a53e7
children 7fdda2416684
files au.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
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);