Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
transcoding: properly initialize AVPacket for audio - coverity
  • Loading branch information
perexg committed May 23, 2016
1 parent 6bfd9f4 commit 97483b2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/plumbing/transcoding.c
Expand Up @@ -497,6 +497,8 @@ transcoder_stream_audio(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt)
icodec = as->aud_icodec;
ocodec = as->aud_ocodec;

av_init_packet(&packet);

if (!avcodec_is_open(ictx)) {
if (icodec->id == AV_CODEC_ID_AAC || icodec->id == AV_CODEC_ID_VORBIS) {
if (ts->ts_input_gh) {
Expand Down Expand Up @@ -526,7 +528,6 @@ transcoder_stream_audio(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt)
as->aud_dec_pts += (pkt->pkt_pts - as->aud_dec_pts);
}

av_init_packet(&packet);
packet.data = pktbuf_ptr(pkt->pkt_payload);
packet.size = pktbuf_len(pkt->pkt_payload);
packet.pts = pkt->pkt_pts;
Expand Down

0 comments on commit 97483b2

Please sign in to comment.