[FFmpeg-cvslog] avformat/asfdec: Check the av_get_packet() return value
Michael Niedermayer
git at videolan.org
Sat Jan 17 20:53:06 CET 2015
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jan 17 20:39:43 2015 +0100| [ab161bfa4b3e4298581471a36ed41f84dfde27da] | committer: Michael Niedermayer
avformat/asfdec: Check the av_get_packet() return value
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ab161bfa4b3e4298581471a36ed41f84dfde27da
---
libavformat/asfdec.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 79a255f..c7d03f0 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -791,12 +791,17 @@ static int asf_read_header(AVFormatContext *s)
if (!s->keylen) {
if (!ff_guidcmp(&g, &ff_asf_content_encryption)) {
unsigned int len;
+ int ret;
AVPacket pkt;
av_log(s, AV_LOG_WARNING,
"DRM protected stream detected, decoding will likely fail!\n");
len= avio_rl32(pb);
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);
get_tag(s, "ASF_Protection_Type", -1, len, 32);
len= avio_rl32(pb);
More information about the ffmpeg-cvslog
mailing list