comparison ac3dec.c @ 9659:b4350a6fb24a libavcodec

ac3dec: fix coupling range check. the start subband must be less than the end subband.
author jbr
date Sat, 16 May 2009 17:02:44 +0000
parents 67a20f0eb42c
children 1fe22274393a
comparison
equal deleted inserted replaced
9658:67a20f0eb42c 9659:b4350a6fb24a
870 870
871 /* coupling frequency range */ 871 /* coupling frequency range */
872 /* TODO: modify coupling end freq if spectral extension is used */ 872 /* TODO: modify coupling end freq if spectral extension is used */
873 cpl_start_subband = get_bits(gbc, 4); 873 cpl_start_subband = get_bits(gbc, 4);
874 cpl_end_subband = get_bits(gbc, 4) + 3; 874 cpl_end_subband = get_bits(gbc, 4) + 3;
875 if (cpl_start_subband > cpl_end_subband) { 875 if (cpl_start_subband >= cpl_end_subband) {
876 av_log(s->avctx, AV_LOG_ERROR, "invalid coupling range (%d > %d)\n", 876 av_log(s->avctx, AV_LOG_ERROR, "invalid coupling range (%d >= %d)\n",
877 cpl_start_subband, cpl_end_subband); 877 cpl_start_subband, cpl_end_subband);
878 return -1; 878 return -1;
879 } 879 }
880 s->start_freq[CPL_CH] = cpl_start_subband * 12 + 37; 880 s->start_freq[CPL_CH] = cpl_start_subband * 12 + 37;
881 s->end_freq[CPL_CH] = cpl_end_subband * 12 + 37; 881 s->end_freq[CPL_CH] = cpl_end_subband * 12 + 37;