From 1ba96a25a548453b431f9342407e4f397ff0b608 Mon Sep 17 00:00:00 2001 From: smn <1911497171@qq.com> Date: Tue, 19 Dec 2023 08:24:28 +0000 Subject: [PATCH] =?UTF-8?q?update=20gst/mxf/mxfd10.c.=20122=E8=A1=8C?= =?UTF-8?q?=E5=8E=9Fif=E6=9D=A1=E4=BB=B6=E8=AF=AD=E5=8F=A5=EF=BC=9Aif=20((?= =?UTF-8?q?map.size=20-=204)=20%=2032=20!=3D=200)=20=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=EF=BC=9A=20=20if=20(map.size=20<=204=20||=20(map.size=20-=204)?= =?UTF-8?q?=20%=2032=20!=3D=200)=20222=E8=A1=8C=E6=B7=BB=E5=8A=A0=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=EF=BC=9A=20s->channel=5Fcount=20>=208=20||?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: smn <1911497171@qq.com> --- gst/mxf/mxfd10.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst/mxf/mxfd10.c b/gst/mxf/mxfd10.c index 21401cf..99c197a 100644 --- a/gst/mxf/mxfd10.c +++ b/gst/mxf/mxfd10.c @@ -119,7 +119,7 @@ mxf_d10_sound_handle_essence_element (const MXFUL * key, GstBuffer * buffer, gst_buffer_map (buffer, &map, GST_MAP_READ); /* Now transform raw AES3 into raw audio, see SMPTE 331M */ - if ((map.size - 4) % 32 != 0) { + if (map.size < 4 || (map.size - 4) % 32 != 0) { gst_buffer_unmap (buffer, &map); GST_ERROR ("Invalid D10 sound essence buffer size"); return GST_FLOW_ERROR; @@ -219,6 +219,7 @@ mxf_d10_create_caps (MXFMetadataTimelineTrack * track, GstTagList ** tags, GstAudioFormat audio_format; if (s->channel_count == 0 || + s->channel_count > 8 || s->quantization_bits == 0 || s->audio_sampling_rate.n == 0 || s->audio_sampling_rate.d == 0) { GST_ERROR ("Invalid descriptor");