aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-20 18:27:25 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-20 18:32:59 +0200
commit207609554981be37db35e4390f49d38d68e890d9 (patch)
tree3cfaf92d63ed01190ebfb499e587b489f3acdd0b
parent05dd5368a92718f3a25f97f4697acffbabc7458f (diff)
downloadffmpeg-207609554981be37db35e4390f49d38d68e890d9.tar.gz
avformat/asfdec: Check av_new_packet()s return code
Fixes CID1041093 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/asfdec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 5fc293e136..7f7bb4d5d4 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -1195,6 +1195,8 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
if (asf_st->pkt.size != asf_st->packet_obj_size ||
// FIXME is this condition sufficient?
asf_st->frag_offset + asf->packet_frag_size > asf_st->pkt.size) {
+ int ret;
+
if (asf_st->pkt.data) {
av_log(s, AV_LOG_INFO,
"freeing incomplete packet size %d, new %d\n",
@@ -1203,7 +1205,8 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
av_free_packet(&asf_st->pkt);
}
/* new packet */
- av_new_packet(&asf_st->pkt, asf_st->packet_obj_size);
+ if ((ret = av_new_packet(&asf_st->pkt, asf_st->packet_obj_size)) < 0)
+ return ret;
asf_st->seq = asf->packet_seq;
if (asf->ts_is_pts) {
asf_st->pkt.pts = asf->packet_frag_timestamp - asf->hdr.preroll;