Commit c77549c5 authored by Yuriy Kaminskiy's avatar Yuriy Kaminskiy Committed by Martin Storsjö
Browse files

rtsp: Set the real_setup pointer properly, avoid out of bounds memory accesses

This fixes a regression since svn rev 24752, where the real_setup pointer
was set incorrectly. The arithmetic with the real_setup_cache pointer
is in units of enum AVDiscard, so the sizeof multiplication should be removed.

Patch by Yuriy Kaminskiy, yumkam at mail dot ru.

Originally committed as revision 25684 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent c4d5ee23
......@@ -136,7 +136,7 @@ static int rtsp_read_header(AVFormatContext *s,
rt->real_setup_cache = av_mallocz(2 * s->nb_streams * sizeof(*rt->real_setup_cache));
if (!rt->real_setup_cache)
return AVERROR(ENOMEM);
rt->real_setup = rt->real_setup_cache + s->nb_streams * sizeof(*rt->real_setup);
rt->real_setup = rt->real_setup_cache + s->nb_streams;
if (ap->initial_pause) {
/* do not start immediately */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment