Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gst-plugins-good gst-plugins-good
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 646
    • Issues 646
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 71
    • Merge requests 71
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GStreamerGStreamer
  • gst-plugins-goodgst-plugins-good
  • Issues
  • #541
Closed
Open
Issue created Jan 04, 2019 by Jérôme Laheurte@jlaheurte

Crash in jpegdec using Panacast camera

I recently encountered a random but frequent SIGSEGV when using the Panacast camera (https://www.panacast.com/). After some debugging it turns out that the first few JPEG frames are sometimes invalid, containing no data at all. The following diff shows how I "fixed" the problem:

--- a/ext/jpeg/gstjpegdec.c
+++ b/ext/jpeg/gstjpegdec.c
@@ -1202,6 +1202,8 @@ gst_jpeg_dec_handle_frame (GstVideoDecoder * bdec, GstVideoCodecFrame * frame)
 
   data = dec->current_frame_map.data;
   nbytes = dec->current_frame_map.size;
+  if (nbytes == 0)
+    goto need_more_data;
   has_eoi = ((data[nbytes - 2] != 0xff) || (data[nbytes - 1] != 0xd9));
 
   /* some cameras fail to send an end-of-image marker (EOI),

I'm not making a merge request because I'm pretty sure this is the wrong way to handle this, so I'm open to suggestions.

Assignee
Assign to
Time tracking