segafilm: Fix potential division by 0 on corrupted streams in the demuxer
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
This commit is contained in:
parent
790f4dd5c9
commit
762ffa6861
@ -113,12 +113,15 @@ static int film_read_header(AVFormatContext *s,
|
|||||||
film->audio_bits = scratch[22];
|
film->audio_bits = scratch[22];
|
||||||
if (scratch[23] == 2)
|
if (scratch[23] == 2)
|
||||||
film->audio_type = CODEC_ID_ADPCM_ADX;
|
film->audio_type = CODEC_ID_ADPCM_ADX;
|
||||||
else if (film->audio_bits == 8)
|
else if (film->audio_channels > 0) {
|
||||||
|
if (film->audio_bits == 8)
|
||||||
film->audio_type = CODEC_ID_PCM_S8;
|
film->audio_type = CODEC_ID_PCM_S8;
|
||||||
else if (film->audio_bits == 16)
|
else if (film->audio_bits == 16)
|
||||||
film->audio_type = CODEC_ID_PCM_S16BE;
|
film->audio_type = CODEC_ID_PCM_S16BE;
|
||||||
else
|
else
|
||||||
film->audio_type = CODEC_ID_NONE;
|
film->audio_type = CODEC_ID_NONE;
|
||||||
|
} else
|
||||||
|
film->audio_type = CODEC_ID_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AV_RB32(&scratch[0]) != FDSC_TAG)
|
if (AV_RB32(&scratch[0]) != FDSC_TAG)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user