[FFmpeg-devel] [PATCH 2/6] lavc/adpcm: THP: handle trailing padding

Michael Niedermayer michaelni at gmx.at
Wed Jun 17 13:48:04 CEST 2015


On Tue, Jun 16, 2015 at 05:28:14PM -0500, Rodger Combs wrote:
> ---
>  libavcodec/adpcm.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
> index 22b5468..07ebce8 100644
> --- a/libavcodec/adpcm.c
> +++ b/libavcodec/adpcm.c
> @@ -637,7 +637,7 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
>      }
>      case AV_CODEC_ID_ADPCM_THP:
>          if (avctx->extradata) {
> -            nb_samples = buf_size / (8 * ch) * 14;
> +            nb_samples = buf_size * 14 / (8 * ch);

doesnt this leave uninitialized samples at the end ?

also theres a 2nd "buf_size / (8 * ch) * 14" a few lines later
is that intended ?

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

DNS cache poisoning attacks, popular search engine, Google internet authority
dont be evil, please
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150617/14d70fd8/attachment.asc>


More information about the ffmpeg-devel mailing list