comparison 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
comparison
equal deleted inserted replaced
6066:490c440a53e7 6067:51ae348d4511
136 id = get_be32(pb); 136 id = get_be32(pb);
137 rate = get_be32(pb); 137 rate = get_be32(pb);
138 channels = get_be32(pb); 138 channels = get_be32(pb);
139 139
140 codec = ff_codec_get_id(codec_au_tags, id); 140 codec = ff_codec_get_id(codec_au_tags, id);
141
142 if (!av_get_bits_per_sample(codec)) {
143 av_log_ask_for_sample(s, "could not determine bits per sample\n");
144 return AVERROR_INVALIDDATA;
145 }
141 146
142 if (size >= 24) { 147 if (size >= 24) {
143 /* skip unused data */ 148 /* skip unused data */
144 url_fseek(pb, size - 24, SEEK_CUR); 149 url_fseek(pb, size - 24, SEEK_CUR);
145 } 150 }