From 4e5735f77429d11a3c981080d8f2177c86c2d929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Tue, 7 Apr 2009 20:52:37 +0000 Subject: [PATCH] Error out also when reading nuv header returns with partial data and return AVERROR(EIO) then. Originally committed as revision 18357 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/nuv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/nuv.c b/libavformat/nuv.c index 9c139e8130..3339a74991 100644 --- a/libavformat/nuv.c +++ b/libavformat/nuv.c @@ -199,8 +199,8 @@ static int nuv_packet(AVFormatContext *s, AVPacket *pkt) { int copyhdrsize = ctx->rtjpg_video ? HDRSIZE : 0; uint64_t pos = url_ftell(pb); ret = get_buffer(pb, hdr, HDRSIZE); - if (ret <= 0) - return ret ? ret : -1; + if (ret < HDRSIZE) + return ret < 0 ? ret : AVERROR(EIO); frametype = hdr[0]; size = PKTSIZE(AV_RL32(&hdr[8])); switch (frametype) {