New submission from Kent Mein <[email protected]>:
Hi,
My name is Kent Mein, I'm a developer for blender. (www.blender.org)
We use ffmpeg with blender and love it.
We also use coverity(http://www.coverity.com) to do static code analysis.
It brought a couple of issues with ffmpeg to our attention, I've provided
a small patch to fix these two issues.
CID: 579
Checker: NULL_RETURNS (help)
File: base/src/extern/ffmpeg/libavformat/r3d.c
Function: r3d_read_red1
Description: Dereferencing NULL value "ast"
and
CID: 576
Checker: FORWARD_NULL (help)
File: base/src/extern/ffmpeg/libavformat/rdt.c
Function: ff_rdt_parse_packet
Description: Variable "buf" tracked as NULL was passed to a function that
dereferences it.
I'll try to provide additional patches that fix other issues as well...
----------
files: coverity.diff
messages: 6749
priority: normal
status: new
substatus: new
title: Patch to fix some coverity issues that were found...
type: patch
_____________________________________________________
FFmpeg issue tracker <[email protected]>
<https://roundup.ffmpeg.org/roundup/ffmpeg/issue1339>
_____________________________________________________
Index: libavformat/rdt.c
===================================================================
--- libavformat/rdt.c (revision 19694)
+++ libavformat/rdt.c (working copy)
@@ -200,6 +200,9 @@
len_included, need_reliable;
uint32_t timestamp;
+ if (!buf)
+ return -1;
+
/* skip status packets */
while (len >= 5 && buf[1] == 0xFF /* status packet */) {
int pkt_len;
Index: libavformat/r3d.c
===================================================================
--- libavformat/r3d.c (revision 19694)
+++ libavformat/r3d.c (working copy)
@@ -87,6 +87,7 @@
dprintf(s, "audio channels %d\n", tmp);
if (tmp > 0) {
AVStream *ast = av_new_stream(s, 1);
+ if (!ast) return -1;
ast->codec->codec_type = CODEC_TYPE_AUDIO;
ast->codec->codec_id = CODEC_ID_PCM_S32BE;
ast->codec->channels = tmp;