mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
h264: don't allocate too big data structures on stack.
This commit is contained in:
parent
830efb3fbd
commit
26c105a6ca
1 changed files with 8 additions and 6 deletions
|
@ -256,7 +256,9 @@ struct _GstVaapiDecoderH264Private {
|
|||
GstBuffer *sub_buffer;
|
||||
GstH264NalParser *parser;
|
||||
GstH264SPS *sps;
|
||||
GstH264SPS last_sps;
|
||||
GstH264PPS *pps;
|
||||
GstH264PPS last_pps;
|
||||
GstVaapiPictureH264 *current_picture;
|
||||
GstVaapiPictureH264 *dpb[16];
|
||||
guint dpb_count;
|
||||
|
@ -681,13 +683,13 @@ static GstVaapiDecoderStatus
|
|||
decode_sps(GstVaapiDecoderH264 *decoder, GstH264NalUnit *nalu)
|
||||
{
|
||||
GstVaapiDecoderH264Private * const priv = decoder->priv;
|
||||
GstH264SPS sps;
|
||||
GstH264SPS * const sps = &priv->last_sps;
|
||||
GstH264ParserResult result;
|
||||
|
||||
GST_DEBUG("decode SPS");
|
||||
|
||||
memset(&sps, 0, sizeof(sps));
|
||||
result = gst_h264_parser_parse_sps(priv->parser, nalu, &sps, TRUE);
|
||||
memset(sps, 0, sizeof(*sps));
|
||||
result = gst_h264_parser_parse_sps(priv->parser, nalu, sps, TRUE);
|
||||
if (result != GST_H264_PARSER_OK)
|
||||
return get_status(result);
|
||||
|
||||
|
@ -698,13 +700,13 @@ static GstVaapiDecoderStatus
|
|||
decode_pps(GstVaapiDecoderH264 *decoder, GstH264NalUnit *nalu)
|
||||
{
|
||||
GstVaapiDecoderH264Private * const priv = decoder->priv;
|
||||
GstH264PPS pps;
|
||||
GstH264PPS * const pps = &priv->last_pps;
|
||||
GstH264ParserResult result;
|
||||
|
||||
GST_DEBUG("decode PPS");
|
||||
|
||||
memset(&pps, 0, sizeof(pps));
|
||||
result = gst_h264_parser_parse_pps(priv->parser, nalu, &pps);
|
||||
memset(pps, 0, sizeof(*pps));
|
||||
result = gst_h264_parser_parse_pps(priv->parser, nalu, pps);
|
||||
if (result != GST_H264_PARSER_OK)
|
||||
return get_status(result);
|
||||
|
||||
|
|
Loading…
Reference in a new issue