aiffdec: fix bits per sample
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 27 Aug 2012 00:02:37 +0000 (02:02 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 27 Aug 2012 00:54:00 +0000 (02:54 +0200)
Fixes Ticket1660

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/aiffdec.c

index 83fa9c3..d56ab53 100644 (file)
@@ -105,7 +105,7 @@ static unsigned int get_aiff_header(AVFormatContext *s, int size,
     codec->codec_type = AVMEDIA_TYPE_AUDIO;
     codec->channels = avio_rb16(pb);
     num_frames = avio_rb32(pb);
-    codec->bits_per_coded_sample = avio_rb16(pb);
+    codec->bits_per_coded_sample = avio_rb16(pb) / FFMAX(codec->channels, 1);
 
     exp = avio_rb16(pb);
     val = avio_rb64(pb);