mirror of https://git.ffmpeg.org/ffmpeg.git
assdec: check av_new_packet return value
CC: libav-stable@libav.org Bug-Id: CID 703626
This commit is contained in:
parent
2cd28693a5
commit
e9ba309831
|
@ -151,6 +151,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||||
{
|
{
|
||||||
ASSContext *ass = s->priv_data;
|
ASSContext *ass = s->priv_data;
|
||||||
uint8_t *p, *end;
|
uint8_t *p, *end;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (ass->event_index >= ass->event_count)
|
if (ass->event_index >= ass->event_count)
|
||||||
return AVERROR(EIO);
|
return AVERROR(EIO);
|
||||||
|
@ -158,7 +159,9 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||||
p = ass->event[ass->event_index];
|
p = ass->event[ass->event_index];
|
||||||
|
|
||||||
end = strchr(p, '\n');
|
end = strchr(p, '\n');
|
||||||
av_new_packet(pkt, end ? end - p + 1 : strlen(p));
|
ret = av_new_packet(pkt, end ? end - p + 1 : strlen(p));
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
pkt->flags |= AV_PKT_FLAG_KEY;
|
pkt->flags |= AV_PKT_FLAG_KEY;
|
||||||
pkt->pos = p - ass->event_buffer + s->streams[0]->codec->extradata_size;
|
pkt->pos = p - ass->event_buffer + s->streams[0]->codec->extradata_size;
|
||||||
pkt->pts = pkt->dts = get_pts(p);
|
pkt->pts = pkt->dts = get_pts(p);
|
||||||
|
|
Loading…
Reference in New Issue