[gstreamer-bugs] [Bug 572863] [32bit] ffdec_nellymoser seg faults (misaligned data)

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Fri Mar 6 08:40:49 PST 2009


If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=572863

  GStreamer | gst-ffmpeg | Ver: git

Edward Hervey changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #130186|none                        |committed
               Flag|                            |
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|HEAD                        |0.10.7




------- Comment #12 from Edward Hervey  2009-03-06 16:41 UTC -------
commit 98167578c45b91b5b73f4e1165fb68d03b10ed92
Author: Edward Hervey <bilboed at bilboed.com>
Date:   Fri Mar 6 17:37:51 2009 +0100

    ffmpegdec: Make sure we provide 16 byte aligned data to ffmpeg. Fixes
#572863

    We simply allocate the memory using ffmpeg's av_malloc which provides us
    with properly memalign'ed data.
    This avoids write-outside-of-bounds when sse/altivec code is being used.

diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c
index aeec910..019140c 100644
--- a/ext/ffmpeg/gstffmpegdec.c
+++ b/ext/ffmpeg/gstffmpegdec.c
@@ -1794,8 +1794,12 @@ gst_ffmpegdec_audio_frame (GstFFMpegDec * ffmpegdec,
       GST_TIME_ARGS (in_timestamp), GST_TIME_ARGS (in_duration),
       GST_TIME_ARGS (ffmpegdec->next_ts));

-  /* outgoing buffer */
-  *outbuf = gst_buffer_new_and_alloc (AVCODEC_MAX_AUDIO_FRAME_SIZE);
+  /* outgoing buffer. We use av_malloc() to have properly aligned memory. */
+  *outbuf = gst_buffer_new ();
+  GST_BUFFER_DATA (*outbuf) = GST_BUFFER_MALLOCDATA (*outbuf) =
+      av_malloc (AVCODEC_MAX_AUDIO_FRAME_SIZE);
+  GST_BUFFER_SIZE (*outbuf) = AVCODEC_MAX_AUDIO_FRAME_SIZE;
+  GST_BUFFER_FREE_FUNC (*outbuf) = av_free;

   len = avcodec_decode_audio2 (ffmpegdec->context,
       (int16_t *) GST_BUFFER_DATA (*outbuf), &have_data, data, size);


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=572863.




More information about the Gstreamer-bugs mailing list