Commit c7905006 authored by Andreas Rheinhardt's avatar Andreas Rheinhardt Committed by Michael Niedermayer

avformat/segafilmenc: Remove redundant checks

If an audio stream is present, the Sega FILM muxer checks for its
compability with the container during init, so that the very same check
needn't be repeated during writing the trailer.

Essentially the same is true for the presence of a video stream: It has
already been checked during init. Furthermore, after the check for the
presence of a video stream succeeded, a pointer is set to point to the
video stream. Yet said pointer (which was NULL before) will be
derefenced anyway regardless of the result of the check. Coverity thus
complained about this in CID 1434155 and removing this pointless check
will also fix this issue.
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent c116dd84
......@@ -292,15 +292,9 @@ static int film_write_header(AVFormatContext *format_context)
if (film->audio_index > -1)
audio = format_context->streams[film->audio_index];
if (film->video_index > -1)
video = format_context->streams[film->video_index];
if (audio != NULL) {
audio_codec = get_audio_codec_id(audio->codecpar->codec_id);
if (audio_codec < 0) {
av_log(format_context, AV_LOG_ERROR, "Incompatible audio stream format.\n");
return AVERROR(EINVAL);
}
}
/* First, write the FILM header; this is very simple */
......@@ -317,6 +311,8 @@ static int film_write_header(AVFormatContext *format_context)
ffio_wfourcc(pb, "FDSC");
avio_wb32(pb, 0x20); /* Size of FDSC chunk */
video = format_context->streams[film->video_index];
/* The only two supported codecs; raw video is rare */
switch (video->codecpar->codec_id) {
case AV_CODEC_ID_CINEPAK:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment