diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-07-13 14:19:26 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-07-13 17:16:30 +0200 |
commit | aecb9d39bc66818dd96956b7248302bf0de6d54d (patch) | |
tree | 807a411ac54d927e13ac311ce748542326e7ab0f /libavformat/rmdec.c | |
parent | 8e3c5c70ca9f5a49fdd70e8a545d8c85e437d811 (diff) | |
download | ffmpeg-aecb9d39bc66818dd96956b7248302bf0de6d54d.tar.gz |
rmdec: Forward error messages from rm_assemble_video_frame() to the caller.
Fixes the cause of a null pointer dereference on oom
described in ticket #2724.
Diffstat (limited to 'libavformat/rmdec.c')
-rw-r--r-- | libavformat/rmdec.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index 70ae8099e9..acfde844be 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -776,11 +776,13 @@ ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb, int *seq, int flags, int64_t timestamp) { RMDemuxContext *rm = s->priv_data; + int ret; if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { rm->current_stream= st->id; - if(rm_assemble_video_frame(s, pb, rm, ast, pkt, len, seq, ×tamp)) - return -1; //got partial frame + ret = rm_assemble_video_frame(s, pb, rm, ast, pkt, len, seq, ×tamp); + if(ret) + return ret; //got partial frame or error } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { if ((ast->deint_id == DEINT_ID_GENR) || (ast->deint_id == DEINT_ID_INT4) || @@ -927,6 +929,8 @@ static int rm_read_packet(AVFormatContext *s, AVPacket *pkt) res = ff_rm_parse_packet (s, s->pb, st, st->priv_data, len, pkt, &seq, flags, timestamp); + if (res < -1) + return res; if((flags&2) && (seq&0x7F) == 1) av_add_index_entry(st, pos, timestamp, 0, 0, AVINDEX_KEYFRAME); if (res) |