Mercurial > libavcodec.hg
comparison pcm.c @ 4506:709ddd620e04 libavcodec
packets with half pcm samples are invalid
author | michael |
---|---|
date | Fri, 09 Feb 2007 13:57:14 +0000 |
parents | 1e251b54cba2 |
children | c800e1a03b9c |
comparison
equal
deleted
inserted
replaced
4505:cb5628800a62 | 4506:709ddd620e04 |
---|---|
408 uint8_t *src; | 408 uint8_t *src; |
409 | 409 |
410 samples = data; | 410 samples = data; |
411 src = buf; | 411 src = buf; |
412 | 412 |
413 n= av_get_bits_per_sample(avctx->codec_id)/8; | |
414 if(n && buf_size % n){ | |
415 av_log(avctx, AV_LOG_ERROR, "invalid PCM packet\n"); | |
416 return -1; | |
417 } | |
418 | |
413 buf_size= FFMIN(buf_size, *data_size/2); | 419 buf_size= FFMIN(buf_size, *data_size/2); |
414 *data_size=0; | 420 *data_size=0; |
415 | 421 |
416 switch(avctx->codec->id) { | 422 switch(avctx->codec->id) { |
417 case CODEC_ID_PCM_S32LE: | 423 case CODEC_ID_PCM_S32LE: |