Skip to content

Commit

Permalink
mxf: Fix off by one error in d10 aes3 decoding
Browse files Browse the repository at this point in the history
Without this fix the last sample was missing from the packet.
  • Loading branch information
cus authored and lu-zero committed Jan 14, 2014
1 parent 42f9132 commit aa0cb16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavformat/mxfdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,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 (; end_ptr - buf_ptr >= st->codec->channels * 4; ) {
for (i = 0; i < st->codec->channels; i++) {
uint32_t sample = bytestream_get_le32(&buf_ptr);
if (st->codec->bits_per_coded_sample == 24)
Expand Down

0 comments on commit aa0cb16

Please sign in to comment.