vformat/subtitles: check av_copy_packets return code
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 30 Aug 2013 18:57:04 +0000 (20:57 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 30 Aug 2013 19:36:58 +0000 (21:36 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/subtitles.c

index 2af0450..21d68a9 100644 (file)
@@ -85,7 +85,9 @@ int ff_subtitles_queue_read_packet(FFDemuxSubtitlesQueue *q, AVPacket *pkt)
 
     if (q->current_sub_idx == q->nb_subs)
         return AVERROR_EOF;
-    av_copy_packet(pkt, sub);
+    if (av_copy_packet(pkt, sub) < 0) {
+        return AVERROR(ENOMEM);
+    }
 
     pkt->dts = pkt->pts;
     q->current_sub_idx++;