[FFmpeg-cvslog] rmdec: Forward error messages from rm_assemble_video_frame() to the caller.
Carl Eugen Hoyos
git at videolan.org
Sat Jul 13 18:11:23 CEST 2013
ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sat Jul 13 14:19:26 2013 +0200| [aecb9d39bc66818dd96956b7248302bf0de6d54d] | committer: Carl Eugen Hoyos
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.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=aecb9d39bc66818dd96956b7248302bf0de6d54d
---
libavformat/rmdec.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 70ae809..acfde84 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)
More information about the ffmpeg-cvslog
mailing list