From: Jaroslav Kysela Date: Fri, 1 Sep 2017 12:31:24 +0000 (+0200) Subject: transcoder: fix the wrong audio codec profile structure access, fixes #4565 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=89b3759730808ba61c85051e15ac210c5f00b530;p=thirdparty%2Ftvheadend.git transcoder: fix the wrong audio codec profile structure access, fixes #4565 --- diff --git a/src/transcoding/transcode/transcoder.c b/src/transcoding/transcode/transcoder.c index af19e9c1c..581099874 100644 --- a/src/transcoding/transcode/transcoder.c +++ b/src/transcoding/transcode/transcoder.c @@ -117,11 +117,15 @@ tvh_transcoder_start(TVHTranscoder *self, tvh_ss_t *ss_src) video_index = i; break; case AVMEDIA_TYPE_AUDIO: - aprofile = (TVHAudioCodecProfile *)self->profiles[media_type]; - if (aprofile && - lang_match(aprofile->language1, ssc, &audio_pindex[0], i) == 0 && - lang_match(aprofile->language2, ssc, &audio_pindex[1], i) == 0) - lang_match(aprofile->language3, ssc, &audio_pindex[2], i); + profile = self->profiles[media_type]; + if (profile && + idnode_is_instance(&profile->idnode, + (idclass_t *)&codec_profile_audio_class)) { + aprofile = (TVHAudioCodecProfile *)profile; + if (lang_match(aprofile->language1, ssc, &audio_pindex[0], i) == 0 && + lang_match(aprofile->language2, ssc, &audio_pindex[1], i) == 0) + lang_match(aprofile->language3, ssc, &audio_pindex[2], i); + } break; case AVMEDIA_TYPE_SUBTITLE: if (subtitle_index < 0)