diff options
author | Peter Ross <pross@xvid.org> | 2010-03-09 15:32:08 +0300 |
---|---|---|
committer | Peter Ross <pross@xvid.org> | 2010-03-09 15:32:08 +0300 |
commit | cc4e8b1267f5562e6b21494618a4deab02b64210 (patch) | |
tree | ba00874c5b042706cf13ea0a88a7b9ce5a44d6c0 /libavformat/bink.c | |
parent | 279a0c976e3cb99f1ac9af0368c6da0000229b54 (diff) |
Ensure Bink demuxer returns AVERROR code when av_get_packet() fails
Originally committed as revision 22389 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/bink.c')
-rw-r--r-- | libavformat/bink.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/bink.c b/libavformat/bink.c index 09da7e2c69..3208d28465 100644 --- a/libavformat/bink.c +++ b/libavformat/bink.c @@ -212,8 +212,8 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) 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 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) /* 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; |