diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-10-24 13:15:40 +0100 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-01-13 00:05:39 +0100 |
commit | 34e7f70f9f493f340daab80eba4f12d005ec3e63 (patch) | |
tree | 8f93bda53fd20392f0c08f7b230e52aada491f54 | |
parent | 242fc6394fecb403bcbd0f652920f2647d0b08ae (diff) | |
download | ffmpeg-34e7f70f9f493f340daab80eba4f12d005ec3e63.tar.gz |
assdec: check av_new_packet return value
CC: libav-stable@libav.org
Bug-Id: CID 703626
-rw-r--r-- | libavformat/assdec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/assdec.c b/libavformat/assdec.c index 7bd3d173ac..08c1222264 100644 --- a/libavformat/assdec.c +++ b/libavformat/assdec.c @@ -151,6 +151,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) { ASSContext *ass = s->priv_data; uint8_t *p, *end; + int ret; if (ass->event_index >= ass->event_count) return AVERROR(EIO); @@ -158,7 +159,9 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) p = ass->event[ass->event_index]; 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->pos = p - ass->event_buffer + s->streams[0]->codec->extradata_size; pkt->pts = pkt->dts = get_pts(p); |