[FFmpeg-devel] [PATCH] mxfdec: fix off by one error in d10 aes3 decoding

Marton Balint cus at passwd.hu
Tue Jul 24 22:13:38 CEST 2012


On Thu, 19 Jul 2012, Marton Balint wrote:

> Without this fix the last sample was missing from the packet.
>

Tomas, could you review the patch below?

> Signed-off-by: Marton Balint <cus at passwd.hu>
> ---
> libavformat/mxfdec.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> index a553eb5..b5eb1ad 100644
> --- a/libavformat/mxfdec.c
> +++ b/libavformat/mxfdec.c
> @@ -322,7 +322,7 @@ static int mxf_get_d10_aes3_packet(AVIOContext *pb, AVStream *st, AVPacket *pkt,
>     data_ptr = pkt->data;
>     end_ptr = pkt->data + length;
>     buf_ptr = pkt->data + 4; /* skip SMPTE 331M header */
> -    for (; buf_ptr + st->codec->channels*4 < end_ptr; ) {
> +    for (; buf_ptr + st->codec->channels*4 <= end_ptr; ) {
>         for (i = 0; i < st->codec->channels; i++) {
>             uint32_t sample = bytestream_get_le32(&buf_ptr);
>             if (st->codec->bits_per_coded_sample == 24)
> -- 
> 1.7.3.4

Thanks,
Marton


More information about the ffmpeg-devel mailing list