Commit ab161bfa authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/asfdec: Check the av_get_packet() return value

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 4adf75ca
...@@ -791,12 +791,17 @@ static int asf_read_header(AVFormatContext *s) ...@@ -791,12 +791,17 @@ static int asf_read_header(AVFormatContext *s)
if (!s->keylen) { if (!s->keylen) {
if (!ff_guidcmp(&g, &ff_asf_content_encryption)) { if (!ff_guidcmp(&g, &ff_asf_content_encryption)) {
unsigned int len; unsigned int len;
int ret;
AVPacket pkt; AVPacket pkt;
av_log(s, AV_LOG_WARNING, av_log(s, AV_LOG_WARNING,
"DRM protected stream detected, decoding will likely fail!\n"); "DRM protected stream detected, decoding will likely fail!\n");
len= avio_rl32(pb); len= avio_rl32(pb);
av_log(s, AV_LOG_DEBUG, "Secret data:\n"); av_log(s, AV_LOG_DEBUG, "Secret data:\n");
av_get_packet(pb, &pkt, len); av_hex_dump_log(s, AV_LOG_DEBUG, pkt.data, pkt.size); av_free_packet(&pkt);
if ((ret = av_get_packet(pb, &pkt, len)) < 0)
return ret;
av_hex_dump_log(s, AV_LOG_DEBUG, pkt.data, pkt.size);
av_free_packet(&pkt);
len= avio_rl32(pb); len= avio_rl32(pb);
get_tag(s, "ASF_Protection_Type", -1, len, 32); get_tag(s, "ASF_Protection_Type", -1, len, 32);
len= avio_rl32(pb); len= avio_rl32(pb);
......
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