comparison mace.c @ 3682:21d96eb9d127 libavcodec

Fix buffer handling for stereo mace files, fixes some random sig11 Patch by Alan Curry !<! pacman !@! TheWorld !.! com !>!
author rtogni
date Tue, 05 Sep 2006 21:17:30 +0000
parents 0b546eab515d
children c8c591fe26f8
comparison
equal deleted inserted replaced
3681:4f547f0da680 3682:21d96eb9d127
408 switch (avctx->codec->id) { 408 switch (avctx->codec->id) {
409 case CODEC_ID_MACE3: 409 case CODEC_ID_MACE3:
410 #ifdef DEBUG 410 #ifdef DEBUG
411 puts("mace_decode_frame[3]()"); 411 puts("mace_decode_frame[3]()");
412 #endif 412 #endif
413 Exp1to3(c, buf, samples, buf_size / 2, avctx->channels, 1); 413 Exp1to3(c, buf, samples, buf_size / 2 / avctx->channels, avctx->channels, 1);
414 if (avctx->channels == 2) 414 if (avctx->channels == 2)
415 Exp1to3(c, buf, samples+1, buf_size / 2, 2, 2); 415 Exp1to3(c, buf, samples+1, buf_size / 2 / 2, 2, 2);
416 *data_size = 2 * 3 * buf_size; 416 *data_size = 2 * 3 * buf_size;
417 break; 417 break;
418 case CODEC_ID_MACE6: 418 case CODEC_ID_MACE6:
419 #ifdef DEBUG 419 #ifdef DEBUG
420 puts("mace_decode_frame[6]()"); 420 puts("mace_decode_frame[6]()");
421 #endif 421 #endif
422 Exp1to6(c, buf, samples, buf_size, avctx->channels, 1); 422 Exp1to6(c, buf, samples, buf_size / avctx->channels, avctx->channels, 1);
423 if (avctx->channels == 2) 423 if (avctx->channels == 2)
424 Exp1to6(c, buf, samples+1, buf_size, 2, 2); 424 Exp1to6(c, buf, samples+1, buf_size / 2, 2, 2);
425 *data_size = 2 * 6 * buf_size; 425 *data_size = 2 * 6 * buf_size;
426 break; 426 break;
427 default: 427 default:
428 return -1; 428 return -1;
429 } 429 }