summaryrefslogtreecommitdiff
path: root/libavformat/subtitles.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/subtitles.c')
-rw-r--r--libavformat/subtitles.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/subtitles.c b/libavformat/subtitles.c
index a3240d88a1..172da5de2b 100644
--- a/libavformat/subtitles.c
+++ b/libavformat/subtitles.c
@@ -211,11 +211,12 @@ void ff_subtitles_queue_finalize(void *log_ctx, FFDemuxSubtitlesQueue *q)
int ff_subtitles_queue_read_packet(FFDemuxSubtitlesQueue *q, AVPacket *pkt)
{
AVPacket *sub = q->subs + q->current_sub_idx;
+ int ret;
if (q->current_sub_idx == q->nb_subs)
return AVERROR_EOF;
- if (av_packet_ref(pkt, sub) < 0) {
- return AVERROR(ENOMEM);
+ if ((ret = av_packet_ref(pkt, sub)) < 0) {
+ return ret;
}
pkt->dts = pkt->pts;