OSDN Git Service

Merge commit '6c145ecf785dc3d26ba3fed3ea9892cc80244625'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 26 Jul 2013 08:30:47 +0000 (10:30 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 26 Jul 2013 08:30:47 +0000 (10:30 +0200)
* commit '6c145ecf785dc3d26ba3fed3ea9892cc80244625':
  twinvq: K&R formatting cosmetics

Conflicts:
libavcodec/twinvq.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/twinvq.c
libavcodec/twinvq_data.h

@@@ -1137,23 -1151,38 +1149,43 @@@ static av_cold int twin_decode_init(AVC
  
      ibps = avctx->bit_rate / (1000 * avctx->channels);
  
-     switch ((isampf << 8) +  ibps) {
-     case (8 <<8) +  8: tctx->mtab = &mode_08_08; break;
-     case (11<<8) +  8: tctx->mtab = &mode_11_08; break;
-     case (11<<8) + 10: tctx->mtab = &mode_11_10; break;
-     case (16<<8) + 16: tctx->mtab = &mode_16_16; break;
-     case (22<<8) + 20: tctx->mtab = &mode_22_20; break;
-     case (22<<8) + 24: tctx->mtab = &mode_22_24; break;
-     case (22<<8) + 32: tctx->mtab = &mode_22_32; break;
-     case (44<<8) + 40: tctx->mtab = &mode_44_40; break;
-     case (44<<8) + 48: tctx->mtab = &mode_44_48; break;
 +    if (ibps > 255U) {
 +        av_log(avctx, AV_LOG_ERROR, "unsupported per channel bitrate %dkbps\n", ibps);
 +        return AVERROR_INVALIDDATA;
 +    }
 +
+     switch ((isampf << 8) + ibps) {
+     case (8 << 8) + 8:
+         tctx->mtab = &mode_08_08;
+         break;
+     case (11 << 8) + 8:
+         tctx->mtab = &mode_11_08;
+         break;
+     case (11 << 8) + 10:
+         tctx->mtab = &mode_11_10;
+         break;
+     case (16 << 8) + 16:
+         tctx->mtab = &mode_16_16;
+         break;
+     case (22 << 8) + 20:
+         tctx->mtab = &mode_22_20;
+         break;
+     case (22 << 8) + 24:
+         tctx->mtab = &mode_22_24;
+         break;
+     case (22 << 8) + 32:
+         tctx->mtab = &mode_22_32;
+         break;
+     case (44 << 8) + 40:
+         tctx->mtab = &mode_44_40;
+         break;
+     case (44 << 8) + 48:
+         tctx->mtab = &mode_44_48;
+         break;
      default:
-         av_log(avctx, AV_LOG_ERROR, "This version does not support %d kHz - %d kbit/s/ch mode.\n", isampf, isampf);
+         av_log(avctx, AV_LOG_ERROR,
+                "This version does not support %d kHz - %d kbit/s/ch mode.\n",
+                isampf, isampf);
          return -1;
      }
  
Simple merge