Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
a06c7e07
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a06c7e07
编写于
8月 13, 2005
作者:
M
Mike Melanson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tinfoil patch: make sure pixel_ptr never goes negative
Originally committed as revision 4513 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
6b892a42
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
2 deletion
+7
-2
libavcodec/qtrle.c
libavcodec/qtrle.c
+7
-2
未找到文件。
libavcodec/qtrle.c
浏览文件 @
a06c7e07
...
...
@@ -58,8 +58,8 @@ typedef struct QtrleContext {
}
#define CHECK_PIXEL_PTR(n) \
if (
pixel_ptr + n > pixel_limit
) { \
av_log (s->avctx, AV_LOG_INFO, "Problem: pixel_ptr
>= pixel_limit (%d >= %d)
\n", \
if (
(pixel_ptr + n > pixel_limit) || (pixel_ptr + n < 0)
) { \
av_log (s->avctx, AV_LOG_INFO, "Problem: pixel_ptr
= %d, pixel_limit = %d
\n", \
pixel_ptr + n, pixel_limit); \
return; \
} \
...
...
@@ -119,6 +119,7 @@ static void qtrle_decode_4bpp(QtrleContext *s)
/* there's another skip code in the stream */
CHECK_STREAM_PTR
(
1
);
pixel_ptr
+=
(
8
*
(
s
->
buf
[
stream_ptr
++
]
-
1
));
CHECK_PIXEL_PTR
(
0
);
/* make sure pixel_ptr is positive */
}
else
if
(
rle_code
<
0
)
{
/* decode the run length code */
rle_code
=
-
rle_code
;
...
...
@@ -209,6 +210,7 @@ static void qtrle_decode_8bpp(QtrleContext *s)
/* there's another skip code in the stream */
CHECK_STREAM_PTR
(
1
);
pixel_ptr
+=
(
4
*
(
s
->
buf
[
stream_ptr
++
]
-
1
));
CHECK_PIXEL_PTR
(
0
);
/* make sure pixel_ptr is positive */
}
else
if
(
rle_code
<
0
)
{
/* decode the run length code */
rle_code
=
-
rle_code
;
...
...
@@ -290,6 +292,7 @@ static void qtrle_decode_16bpp(QtrleContext *s)
/* there's another skip code in the stream */
CHECK_STREAM_PTR
(
1
);
pixel_ptr
+=
(
s
->
buf
[
stream_ptr
++
]
-
1
)
*
2
;
CHECK_PIXEL_PTR
(
0
);
/* make sure pixel_ptr is positive */
}
else
if
(
rle_code
<
0
)
{
/* decode the run length code */
rle_code
=
-
rle_code
;
...
...
@@ -367,6 +370,7 @@ static void qtrle_decode_24bpp(QtrleContext *s)
/* there's another skip code in the stream */
CHECK_STREAM_PTR
(
1
);
pixel_ptr
+=
(
s
->
buf
[
stream_ptr
++
]
-
1
)
*
3
;
CHECK_PIXEL_PTR
(
0
);
/* make sure pixel_ptr is positive */
}
else
if
(
rle_code
<
0
)
{
/* decode the run length code */
rle_code
=
-
rle_code
;
...
...
@@ -446,6 +450,7 @@ static void qtrle_decode_32bpp(QtrleContext *s)
/* there's another skip code in the stream */
CHECK_STREAM_PTR
(
1
);
pixel_ptr
+=
(
s
->
buf
[
stream_ptr
++
]
-
1
)
*
4
;
CHECK_PIXEL_PTR
(
0
);
/* make sure pixel_ptr is positive */
}
else
if
(
rle_code
<
0
)
{
/* decode the run length code */
rle_code
=
-
rle_code
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录