mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-08 21:28:45 +00:00
qtdemux: guard against invalid frame size to avoid division by 0
Coverity 1139690
This commit is contained in:
parent
436c8c11a0
commit
b692539b55
1 changed files with 8 additions and 0 deletions
|
@ -3885,6 +3885,9 @@ gst_qtdemux_clip_buffer (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
||||||
} else
|
} else
|
||||||
goto wrong_type;
|
goto wrong_type;
|
||||||
|
|
||||||
|
if (frame_size <= 0)
|
||||||
|
goto bad_frame_size;
|
||||||
|
|
||||||
/* we can only clip if we have a valid pts */
|
/* we can only clip if we have a valid pts */
|
||||||
pts = GST_BUFFER_PTS (buf);
|
pts = GST_BUFFER_PTS (buf);
|
||||||
if (G_UNLIKELY (!GST_CLOCK_TIME_IS_VALID (pts)))
|
if (G_UNLIKELY (!GST_CLOCK_TIME_IS_VALID (pts)))
|
||||||
|
@ -3953,6 +3956,11 @@ wrong_type:
|
||||||
GST_DEBUG_OBJECT (qtdemux, "unknown stream type");
|
GST_DEBUG_OBJECT (qtdemux, "unknown stream type");
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
bad_frame_size:
|
||||||
|
{
|
||||||
|
GST_DEBUG_OBJECT (qtdemux, "bad frame size");
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
no_pts:
|
no_pts:
|
||||||
{
|
{
|
||||||
GST_DEBUG_OBJECT (qtdemux, "no pts on buffer");
|
GST_DEBUG_OBJECT (qtdemux, "no pts on buffer");
|
||||||
|
|
Loading…
Reference in a new issue