changeset 5796:a8bf262a9302 libavformat

Ensure Bink demuxer returns AVERROR code when av_get_packet() fails
author pross
date Tue, 09 Mar 2010 12:32:08 +0000
parents 67059af53c04
children e0e1ddbfca1a
files bink.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/bink.c	Tue Mar 09 04:23:36 2010 +0000
+++ b/bink.c	Tue Mar 09 12:32:08 2010 +0000
@@ -212,8 +212,8 @@
         bink->current_track++;
         if (audio_size >= 4) {
             /* get one audio packet per track */
-            if ((ret = av_get_packet(pb, pkt, audio_size)) <= 0)
-                return ret;
+            if ((ret = av_get_packet(pb, pkt, audio_size)) != audio_size)
+                return ret < 0 ? ret : AVERROR(EIO);;
             pkt->stream_index = bink->current_track;
             pkt->pts = bink->audio_pts[bink->current_track - 1];
 
@@ -230,7 +230,7 @@
     /* get video packet */
     if ((ret = av_get_packet(pb, pkt, bink->remain_packet_size))
                                    != bink->remain_packet_size)
-        return ret;
+        return ret < 0 ? ret : AVERROR(EIO);
     pkt->stream_index = 0;
     pkt->pts = bink->video_pts++;
     pkt->flags |= PKT_FLAG_KEY;