]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/idroqdec.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavformat / idroqdec.c
index 5c1528de0fc85d80c715b3815bb5256b2e67e19a..096ada2ba9835c0296cc09e4e609f4e2a7d69a4a 100644 (file)
@@ -2,20 +2,20 @@
  * id RoQ (.roq) File Demuxer
  * Copyright (c) 2003 The ffmpeg Project
  *
- * This file is part of Libav.
+ * This file is part of FFmpeg.
  *
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
@@ -30,6 +30,7 @@
 #include "libavutil/intreadwrite.h"
 #include "avformat.h"
 #include "internal.h"
+#include "avio_internal.h"
 
 #define RoQ_MAGIC_NUMBER 0x1084
 #define RoQ_CHUNK_PREAMBLE_SIZE 8
@@ -104,7 +105,7 @@ static int roq_read_packet(AVFormatContext *s,
 
     while (!packet_read) {
 
-        if (s->pb->eof_reached)
+        if (url_feof(s->pb))
             return AVERROR(EIO);
 
         /* get the next chunk preamble */
@@ -117,6 +118,8 @@ static int roq_read_packet(AVFormatContext *s,
         if(chunk_size > INT_MAX)
             return AVERROR_INVALIDDATA;
 
+        chunk_size = ffio_limit(pb, chunk_size);
+
         switch (chunk_type) {
 
         case RoQ_INFO: