summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-07-29 12:53:57 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-07-29 13:01:20 +0200
commit5fb652dddb79feabec91002ed6f5accb6ccb633d (patch)
treea7e6e54036186bdc4575cf61265bc91cbfeaa413 /libavformat
parent9d8fb23747239f6e747000254c91f0510e4eb1e1 (diff)
parent2219e27b5b17d146e4ab71a3ed86dfc013fb7a93 (diff)
Merge commit '2219e27b5b17d146e4ab71a3ed86dfc013fb7a93'
* commit '2219e27b5b17d146e4ab71a3ed86dfc013fb7a93': oma: correctly mark and decrypt partial packets Conflicts: libavformat/omadec.c See: dcd013a535bccbb163b740b72bbedde67dc8e633 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/omadec.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libavformat/omadec.c b/libavformat/omadec.c
index 8547bf0559..d05795494c 100644
--- a/libavformat/omadec.c
+++ b/libavformat/omadec.c
@@ -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;