After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 137504 - mpeg2dec fails on 422 encoded material
mpeg2dec fails on 422 encoded material
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins
0.8.0
Other Linux
: Normal normal
: 0.8.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-03-17 16:05 UTC by Matthew Spencer
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.3/2.4


Attachments
patch for gstmpeg2dec.c (2.93 KB, patch)
2004-03-22 15:57 UTC, Matthew Spencer
none Details | Review
Patch for gstmpeg2dec.h (333 bytes, patch)
2004-03-22 15:58 UTC, Matthew Spencer
none Details | Review

Description Matthew Spencer 2004-03-17 16:05:43 UTC
I am currently working on an MXF demuxer that uses gstreamer, but I am
running into a problem with this pipeline (using gstreamer version 0.8.0):

 filesrc location=file.mxf ! mxfdemux ! mpeg2dec ! xvimagesink

The pipeline segfaults in mpeg2dec.  If I run this pipeline (or something
like):

 filesrc location=file.mxf ! mxfdemux ! fdsink fd=1 | mpeg2dec /proc/self/fd/1

all goes fine.

I have been analyzing the problem using valgrind at it seems that on my
system (Fedora core 1) the mpeg2dec is overrunning its buffers when
decoding.  Valgrinds output from the simple pipeline:

 filesrc location=file.mpeg2 ! mpeg2dec ! xvimagesink

if gives me the output:
Invalid write of size 8
==22720==    at 0x4C16D40: mpeg2_idct_copy_mmxext (idct_mmx.c:613)
==22720==    by 0x4C068CE: mpeg2_slice (slice.c:954)
==22720==    by 0x4C04704: mpeg2_parse (decode.c:188)
==22720==    by 0x6501FE: gst_mpeg2dec_chain (gstmpeg2dec.c:478)
==22720==    by 0xD9F6A4: gst_pad_push (gstpad.c:3032)
==22720==    by 0xE700C2: get_group_schedule_function
(gstoptimalscheduler.c:1138)
==22720==    by 0xE6FC41: schedule_group (gstoptimalscheduler.c:1007)
==22720==    by 0xE6FCF7: gst_opt_scheduler_schedule_run_queue
(gstoptimalscheduler.c:1050)
==22720==    Address 0x3ACD524 is 0 bytes after a block of size 656640 alloc'd
==22720==    at 0xE8A68E: malloc (vg_replace_malloc.c:153)
==22720==    by 0xAF38C6: g_malloc (in /usr/lib/libglib-2.0.so.0.200.3)
==22720==    by 0xD85B9F: gst_buffer_new_and_alloc (gstbuffer.c:224)
==22720==    by 0x64FE04: gst_mpeg2dec_alloc_buffer (gstmpeg2dec.c:293)
==22720==    by 0x6503CD: gst_mpeg2dec_chain (gstmpeg2dec.c:508)
==22720==    by 0xD9F6A4: gst_pad_push (gstpad.c:3032)
==22720==    by 0xE700C2: get_group_schedule_function
(gstoptimalscheduler.c:1138)
==22720==    by 0xE6FC41: schedule_group (gstoptimalscheduler.c:1007)

informing us that the buffer being read from that was allocated by
'gst_mpeg2dec_alloc_buffer' is being accessed invalidly.

I checked mpeg2dec command line tool for processing the same file, and I
get no such error.
Comment 1 Matthew Spencer 2004-03-17 16:08:55 UTC
The problem appears to be beacuse the content is encoded 422 (not 420
as assumed by the mpeg2dec plugin).  This problem can be reproduced in
100% of the 422 content that I have tried.
Comment 2 David I. Lehn 2004-03-18 20:16:56 UTC
the mpeg2dec library should be able to handle 422 material.  the caps
need to be updated to handle 422 however.
Comment 3 Matthew Spencer 2004-03-22 15:57:19 UTC
Created attachment 25882 [details] [review]
patch for gstmpeg2dec.c
Comment 4 Matthew Spencer 2004-03-22 15:58:04 UTC
Created attachment 25883 [details] [review]
Patch for gstmpeg2dec.h
Comment 5 Matthew Spencer 2004-03-22 15:59:54 UTC
I have attched patches for gstmpeg2dec.[ch] that fixes the problem of
422 playback here whilst still allowing 420 playback of standard
content.  Could this be tested please with a view to applying to cvs-head?
Comment 6 Ronald Bultje 2004-03-22 17:59:21 UTC
Can you provide a sample file with 422-material for us to test?
Video-only elementary streams are ok, mpeg1videoparse can parse those.
Comment 7 David Schleef 2004-03-31 06:31:41 UTC
Applied.  We still need a test file.