mirror of https://git.ffmpeg.org/ffmpeg.git
Merge commit '2219e27b5b17d146e4ab71a3ed86dfc013fb7a93'
* commit '2219e27b5b17d146e4ab71a3ed86dfc013fb7a93':
oma: correctly mark and decrypt partial packets
Conflicts:
libavformat/omadec.c
See: dcd013a535
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
5fb652dddb
|
@ -410,6 +410,9 @@ static int oma_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||||
int packet_size = s->streams[0]->codec->block_align;
|
int packet_size = s->streams[0]->codec->block_align;
|
||||||
int ret = av_get_packet(s->pb, pkt, packet_size);
|
int ret = av_get_packet(s->pb, pkt, packet_size);
|
||||||
|
|
||||||
|
if (ret < packet_size)
|
||||||
|
pkt->flags |= AV_PKT_FLAG_CORRUPT;
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
if (!ret)
|
if (!ret)
|
||||||
|
@ -420,8 +423,11 @@ static int oma_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||||
if (oc->encrypted) {
|
if (oc->encrypted) {
|
||||||
/* previous unencrypted block saved in IV for
|
/* previous unencrypted block saved in IV for
|
||||||
* the next packet (CBC mode) */
|
* the next packet (CBC mode) */
|
||||||
av_des_crypt(&oc->av_des, pkt->data, pkt->data,
|
if (ret == packet_size)
|
||||||
(ret >> 3), oc->iv, 1);
|
av_des_crypt(&oc->av_des, pkt->data, pkt->data,
|
||||||
|
(packet_size >> 3), oc->iv, 1);
|
||||||
|
else
|
||||||
|
memset(oc->iv, 0, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue