From 54fd0c0596e8bd47adb9ac325ddb93d99647fe83 Mon Sep 17 00:00:00 2001 From: Marcel Groothuis Date: Sat, 12 Mar 2011 23:02:06 +0100 Subject: [PATCH] ffmpeg: add missing check for NULL pointer Extends commit 8ec66e240fe0a9f672d7ff1932022f22f8332ffb (fixed: playing mpegts over rtsp caused ffmpeg to read uninitialized stack values) --- lib/ffmpeg/libavformat/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ffmpeg/libavformat/utils.c b/lib/ffmpeg/libavformat/utils.c index bee0475dcd6df..d3c11e2c6d838 100644 --- a/lib/ffmpeg/libavformat/utils.c +++ b/lib/ffmpeg/libavformat/utils.c @@ -1092,7 +1092,7 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt) av_add_index_entry(st, pkt->pos, pkt->dts, 0, 0, AVINDEX_KEYFRAME); } break; - } else if (st->cur_len > 0 && st->discard < AVDISCARD_ALL) { + } else if (st->cur_len > 0 && st->cur_ptr && st->discard < AVDISCARD_ALL) { len = av_parser_parse2(st->parser, st->codec, &pkt->data, &pkt->size, st->cur_ptr, st->cur_len, st->cur_pkt.pts, st->cur_pkt.dts,