Commit 5fb652dd authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '2219e27b'

* commit '2219e27b':
  oma: correctly mark and decrypt partial packets

Conflicts:
	libavformat/omadec.c

See: dcd013a5Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 9d8fb237 2219e27b
......@@ -410,6 +410,9 @@ static int oma_read_packet(AVFormatContext *s, AVPacket *pkt)
int packet_size = s->streams[0]->codec->block_align;
int ret = av_get_packet(s->pb, pkt, packet_size);
if (ret < packet_size)
pkt->flags |= AV_PKT_FLAG_CORRUPT;
if (ret < 0)
return ret;
if (!ret)
......@@ -420,8 +423,11 @@ static int oma_read_packet(AVFormatContext *s, AVPacket *pkt)
if (oc->encrypted) {
/* previous unencrypted block saved in IV for
* the next packet (CBC mode) */
av_des_crypt(&oc->av_des, pkt->data, pkt->data,
(ret >> 3), oc->iv, 1);
if (ret == packet_size)
av_des_crypt(&oc->av_des, pkt->data, pkt->data,
(packet_size >> 3), oc->iv, 1);
else
memset(oc->iv, 0, 8);
}
return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment