]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/idroqdec.c
nutenc: fix a memleak
[ffmpeg] / libavformat / idroqdec.c
index 71324d8803ec2b514fe7bc49efe4236b364b139e..92c48d42fe6f03b7336fe4d7d1350904544e652b 100644 (file)
@@ -111,7 +111,7 @@ static int roq_read_packet(AVFormatContext *s,
 
     while (!packet_read) {
 
-        if (url_feof(s->pb))
+        if (s->pb->eof_reached)
             return AVERROR(EIO);
 
         /* get the next chunk preamble */
@@ -136,14 +136,14 @@ static int roq_read_packet(AVFormatContext *s,
                 break;
             }
             /* don't care about this chunk anymore */
-            avio_seek(pb, RoQ_CHUNK_PREAMBLE_SIZE, SEEK_CUR);
+            avio_skip(pb, RoQ_CHUNK_PREAMBLE_SIZE);
             break;
 
         case RoQ_QUAD_CODEBOOK:
             /* packet needs to contain both this codebook and next VQ chunk */
-            codebook_offset = url_ftell(pb) - RoQ_CHUNK_PREAMBLE_SIZE;
+            codebook_offset = avio_tell(pb) - RoQ_CHUNK_PREAMBLE_SIZE;
             codebook_size = chunk_size;
-            avio_seek(pb, codebook_size, SEEK_CUR);
+            avio_skip(pb, codebook_size);
             if (avio_read(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) !=
                 RoQ_CHUNK_PREAMBLE_SIZE)
                 return AVERROR(EIO);
@@ -197,7 +197,7 @@ static int roq_read_packet(AVFormatContext *s,
                 roq->audio_frame_count += (chunk_size / roq->audio_channels);
             }
 
-            pkt->pos= url_ftell(pb);
+            pkt->pos= avio_tell(pb);
             ret = avio_read(pb, pkt->data + RoQ_CHUNK_PREAMBLE_SIZE,
                 chunk_size);
             if (ret != chunk_size)