]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
fix end-of-file detection
authorgpoirier <gpoirier@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 18 Mar 2007 23:59:56 +0000 (23:59 +0000)
committergpoirier <gpoirier@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 18 Mar 2007 23:59:56 +0000 (23:59 +0000)
At the end of a nut file, the check for url_feof() fails because the
eof flag was cleared by the url_fseek() call that was used to skip over
the index packet.    This patch fixes this
patch by: Clemens Ladisch % cladisch A fastmail P net %
Original thread:
Date: Feb 27, 2007 6:13 PM
Subject: [Ffmpeg-devel] [PATCH] nutdec: fix end-of-file detection

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

libavformat/nutdec.c

index ec1c04e0f921c5e42d0cafe13c4ae7c5785119ba..c0f331c27c58fbdf5269adb0d7b6af0a451d75fb 100644 (file)
@@ -737,13 +737,12 @@ static int nut_read_packet(AVFormatContext *s, AVPacket *pkt)
         uint64_t tmp= nut->next_startcode;
         nut->next_startcode=0;
 
-        if (url_feof(bc))
-            return -1;
-
         if(tmp){
             pos-=8;
         }else{
             frame_code = get_byte(bc);
+            if(url_feof(bc))
+                return -1;
             if(frame_code == 'N'){
                 tmp= frame_code;
                 for(i=1; i<8; i++)