]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/tta.c
lavc/qsvdec: add function ff_qsv_map_picstruct()
[ffmpeg] / libavcodec / tta.c
index 8f097b3bcc7fcbe9d69c4accd43fefc716f340e8..4d27fcd5551e518da9392eeb0ca38fc1f5ef7bfc 100644 (file)
@@ -163,7 +163,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
         s->data_length = get_bits_long(&gb, 32);
         skip_bits_long(&gb, 32); // CRC32 of header
 
-        if (s->channels == 0) {
+        if (s->channels == 0 || s->channels > 16) {
             av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n");
             return AVERROR_INVALIDDATA;
         } else if (avctx->sample_rate == 0) {
@@ -372,7 +372,7 @@ static int tta_decode_frame(AVCodecContext *avctx, void *data,
         // shift samples for 24-bit sample format
         int32_t *samples = (int32_t *)frame->data[0];
         for (i = 0; i < framelen * s->channels; i++)
-            *samples++ <<= 8;
+            *samples++ *= 256;
         // reset decode buffer
         s->decode_buffer = NULL;
         break;