comparison mlpdec.c @ 9614:2d9e7d5cd89b libavcodec

mlpdec: Fix possible writing out of array bounds introduced by being under-paranoid in r18651.
author ramiro
date Wed, 06 May 2009 16:01:28 +0000
parents 56f0a4054770
children d0fe5dc427f0
comparison
equal deleted inserted replaced
9613:56f0a4054770 9614:2d9e7d5cd89b
375 av_log(m->avctx, AV_LOG_ERROR, 375 av_log(m->avctx, AV_LOG_ERROR,
376 "Max channel must be equal max matrix channel.\n"); 376 "Max channel must be equal max matrix channel.\n");
377 return -1; 377 return -1;
378 } 378 }
379 379
380 /* This should happen for TrueHD streams with >6 channels and MLP's noise
381 * type. It is not yet known if this is allowed. */
382 if (s->max_channel > MAX_MATRIX_CHANNEL_MLP && !s->noise_type) {
383 av_log(m->avctx, AV_LOG_ERROR,
384 "Number of channels %d is larger than the maximum supported "
385 "by the decoder. %s\n", s->max_channel+2, sample_message);
386 return -1;
387 }
388
380 if (s->min_channel > s->max_channel) { 389 if (s->min_channel > s->max_channel) {
381 av_log(m->avctx, AV_LOG_ERROR, 390 av_log(m->avctx, AV_LOG_ERROR,
382 "Substream min channel cannot be greater than max channel.\n"); 391 "Substream min channel cannot be greater than max channel.\n");
383 return -1; 392 return -1;
384 } 393 }