changeset 4561:86bbca6f1738 libavformat

check av_get_packet return value
author bcoudurier
date Sun, 22 Feb 2009 01:07:46 +0000
parents 284c22e8f739
children 69cb74b61706
files mov.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mov.c	Sun Feb 22 00:20:07 2009 +0000
+++ b/mov.c	Sun Feb 22 01:07:46 2009 +0000
@@ -1942,7 +1942,7 @@
     MOVStreamContext *sc = 0;
     AVIndexEntry *sample = 0;
     int64_t best_dts = INT64_MAX;
-    int i;
+    int i, ret;
  retry:
     for (i = 0; i < s->nb_streams; i++) {
         AVStream *st = s->streams[i];
@@ -1979,7 +1979,9 @@
                sc->ffindex, sample->pos);
         return -1;
     }
-    av_get_packet(sc->pb, pkt, sample->size);
+    ret = av_get_packet(sc->pb, pkt, sample->size);
+    if (ret < 0)
+        return ret;
 #if CONFIG_DV_DEMUXER
     if (mov->dv_demux && sc->dv_audio_container) {
         dv_produce_packet(mov->dv_demux, pkt, pkt->data, pkt->size);