[SCM] libav/experimental: rtsp: Set the real_setup pointer properly, avoid out of bounds memory accesses

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:18:41 UTC 2013


The following commit has been merged in the experimental branch:
commit c77549c510370eaaa2e2bb1f15d1a30f29e30950
Author: Yuriy Kaminskiy <yumkam at mail.ru>
Date:   Sat Nov 6 23:26:49 2010 +0000

    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

diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index d2f49a4..fd74b08 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -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 */

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list