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 775130 - h264 parser: invalid input causes assert
h264 parser: invalid input causes assert
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.10.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-11-26 09:47 UTC by Hanno Böck
Modified: 2016-11-26 10:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
poc file (1.12 KB, application/octet-stream)
2016-11-26 09:47 UTC, Hanno Böck
  Details
h264parse: Fix assertion when encountering an invalid NALU (1020 bytes, patch)
2016-11-26 10:18 UTC, Sebastian Dröge (slomo)
committed Details | Review
h265parse: Fix assertion when encountering an invalid NALU (1.01 KB, patch)
2016-11-26 10:18 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Hanno Böck 2016-11-26 09:47:26 UTC
Created attachment 340789 [details]
poc file

The attached file will cause a call to an assert.

This happens in the file gst/videoparsers/gsth264parse.c (line 1134 in current git). After a call to gst_h264_parser_identify_nalu_unchecked() a switch/case statement checks for return values GST_H264_PARSER_OK and GST_H264_PARSER_NO_NAL and for all other values calls g_assert_not_reached.

However the function (file gst-libs/gst/codecparsers/gsth264parser.c) can also return GST_H264_PARSER_ERROR. Therefore this should be added to the switch/case statement and returned with a graceful error.
Comment 1 Sebastian Dröge (slomo) 2016-11-26 10:17:39 UTC
commit cb4ccecc97cbca784285bb1e735e0197ffd1eac3
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Sat Nov 26 12:16:18 2016 +0200

    h265parse: Fix assertion when encountering an invalid NALU
    
    Error out properly instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=775130

commit 47bf425cba1bfe056adbd630fa2858d053ddf379
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Sat Nov 26 12:15:50 2016 +0200

    h264parse: Fix assertion when encountering an invalid NALU
    
    Error out properly instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=775130
Comment 2 Sebastian Dröge (slomo) 2016-11-26 10:18:12 UTC
Created attachment 340791 [details] [review]
h264parse: Fix assertion when encountering an invalid NALU

Error out properly instead.
Comment 3 Sebastian Dröge (slomo) 2016-11-26 10:18:17 UTC
Created attachment 340792 [details] [review]
h265parse: Fix assertion when encountering an invalid NALU

Error out properly instead.