avformat/subtitles: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2021-02-03 20:55:27 -03:00
parent fd23efb20b
commit 98a776b5e3
6 changed files with 45 additions and 40 deletions

View File

@@ -934,7 +934,7 @@ static int vobsub_read_packet(AVFormatContext *s, AVPacket *pkt)
if (tmpq->current_sub_idx >= tmpq->nb_subs)
continue;
ts = tmpq->subs[tmpq->current_sub_idx].pts;
ts = tmpq->subs[tmpq->current_sub_idx]->pts;
if (ts < min_ts) {
min_ts = ts;
sid = i;
@@ -950,7 +950,7 @@ static int vobsub_read_packet(AVFormatContext *s, AVPacket *pkt)
/* compute maximum packet size using the next packet position. This is
* useful when the len in the header is non-sense */
if (q->current_sub_idx < q->nb_subs) {
psize = q->subs[q->current_sub_idx].pos - pkt->pos;
psize = q->subs[q->current_sub_idx]->pos - pkt->pos;
} else {
int64_t fsize = avio_size(pb);
psize = fsize < 0 ? 0xffff : fsize - pkt->pos;