]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
transcoding: subtitle - fix AVSubtittle variable initialization - coverity
authorJaroslav Kysela <perex@perex.cz>
Mon, 23 May 2016 19:17:28 +0000 (21:17 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 23 May 2016 19:17:28 +0000 (21:17 +0200)
src/plumbing/transcoding.c

index e7a327d7e938cee5e8fba3f6c818d09d9ca18aba..01146ad1df1e4a43f35b41b25a94ea22482d425f 100644 (file)
@@ -401,7 +401,7 @@ transcoder_stream_subtitle(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *p
   AVCodecContext *ictx;
   AVPacket packet;
   AVSubtitle sub;
-  int length,  got_subtitle;
+  int length, got_subtitle;
 
   subtitle_stream_t *ss = (subtitle_stream_t*)ts;
 
@@ -411,12 +411,13 @@ transcoder_stream_subtitle(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *p
   icodec = ss->sub_icodec;
   //ocodec = ss->sub_ocodec;
 
+
   if (!avcodec_is_open(ictx)) {
     if (avcodec_open2(ictx, icodec, NULL) < 0) {
       tvherror("transcode", "%04X: Unable to open %s decoder",
                shortid(t), icodec->name);
       transcoder_stream_invalidate(ts);
-      goto cleanup;
+      return;
     }
   }
 
@@ -427,6 +428,8 @@ transcoder_stream_subtitle(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *p
   packet.dts      = pkt->pkt_dts;
   packet.duration = pkt->pkt_duration;
 
+  memset(&sub, 0, sizeof(sub));
+
   length = avcodec_decode_subtitle2(ictx,  &sub, &got_subtitle, &packet);
   if (length <= 0) {
     if (length == AVERROR_INVALIDDATA) goto cleanup;