]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/xmv.c
Merge commit 'bfe5454cd238b16e7977085f880205229103eccb'
[ffmpeg] / libavformat / xmv.c
index f250aad0b2e2a340e140ff8ea7495922136bd720..b447d6cd25caf3f82ae160d7c342582daf55e9d3 100644 (file)
@@ -77,7 +77,7 @@ typedef struct XMVAudioPacket {
     uint16_t bits_per_sample; ///< Bits per compressed sample.
     uint32_t bit_rate;        ///< Bits of compressed data per second.
     uint16_t flags;           ///< Flags
-    uint16_t block_align;     ///< Bytes per compressed block.
+    unsigned block_align;     ///< Bytes per compressed block.
     uint16_t block_samples;   ///< Decompressed samples per compressed block.
 
     enum AVCodecID codec_id; ///< The codec ID of the compression scheme.
@@ -379,6 +379,9 @@ static int xmv_fetch_new_packet(AVFormatContext *s)
     AVIOContext     *pb  = s->pb;
     int result;
 
+    if (xmv->this_packet_offset == xmv->next_packet_offset)
+        return AVERROR_EOF;
+
     /* Seek to it */
     xmv->this_packet_offset = xmv->next_packet_offset;
     if (avio_seek(pb, xmv->this_packet_offset, SEEK_SET) != xmv->this_packet_offset)