当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
120 Star 0 Fork 8

src-openEuler/gstreamer-plugins-base
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CVE-2017-5844.patch 2.26 KB
一键复制 编辑 原始数据 按行查看 历史
AlexZ11 提交于 2019-11-28 20:36 . gstreamer-plugins-base:initialize
--- a/gst-libs/gst/riff/riff-media.c 2019-04-10 17:19:15.918000000 +0800
+++ b/gst-libs/gst/riff/riff-media-change.c 2019-04-10 17:25:28.619000000 +0800
@@ -1196,24 +1196,30 @@ gst_riff_create_audio_caps (guint16 code
if (strf != NULL) {
gint ba = strf->blockalign;
gint ch = strf->channels;
- gint wd = ba * 8 / ch;
- caps = gst_caps_new_simple ("audio/x-raw-float",
- "endianness", G_TYPE_INT, G_LITTLE_ENDIAN,
- "channels", G_TYPE_INT, ch, "width", G_TYPE_INT, wd, NULL);
+ if (ba > 0 && ch > 0 && (ba == (64 / 8) * ch || ba == (32 / 8) * ch)) {
+ gint wd = ba * 8 / ch;
- /* Add default channel layout. In theory this should be done
- * for 1 and 2 channels too but apparently breaks too many
- * things currently. Also we know no default layout for more than
- * 8 channels. */
- if (ch > 2) {
- if (ch > 8)
- GST_WARNING ("don't know default layout for %d channels", ch);
- else if (gst_riff_wave_add_default_channel_layout (caps))
- GST_DEBUG ("using default channel layout for %d channels", ch);
- else
- GST_WARNING ("failed to add channel layout");
- }
+ caps = gst_caps_new_simple ("audio/x-raw-float",
+ "endianness", G_TYPE_INT, G_LITTLE_ENDIAN,
+ "channels", G_TYPE_INT, ch, "width", G_TYPE_INT, wd, NULL);
+
+ /* Add default channel layout. In theory this should be done
+ * for 1 and 2 channels too but apparently breaks too many
+ * things currently. Also we know no default layout for more than
+ * 8 channels. */
+ if (ch > 2) {
+ if (ch > 8)
+ GST_WARNING ("don't know default layout for %d channels", ch);
+ else if (gst_riff_wave_add_default_channel_layout (caps))
+ GST_DEBUG ("using default channel layout for %d channels", ch);
+ else
+ GST_WARNING ("failed to add channel layout");
+ }
+ } else {
+ GST_WARNING ("invalid block align %d or channel count %d", ba, ch);
+ return NULL;
+ }
} else {
/* FIXME: this is pretty useless - we need fixed caps */
caps = gst_caps_from_string ("audio/x-raw-float, "
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/gstreamer-plugins-base.git
git@gitee.com:src-openeuler/gstreamer-plugins-base.git
src-openeuler
gstreamer-plugins-base
gstreamer-plugins-base
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385