]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Error out also when reading nuv header returns with partial data and return
authorreimar <reimar@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 7 Apr 2009 20:52:37 +0000 (20:52 +0000)
committerreimar <reimar@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 7 Apr 2009 20:52:37 +0000 (20:52 +0000)
AVERROR(EIO) then.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18357 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavformat/nuv.c

index 9c139e81300f5156128ad93c7a7e5e48f322f2c4..3339a74991096b39f4adb866cf06a39832ccc108 100644 (file)
@@ -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) {