ffmpeg | branch: master | Andreas Cadhalpun <andreas.cadhal...@googlemail.com> 
| Wed Jan  6 19:03:17 2016 +0100| [3776a72962b0622af17c4aef89a831da2cbaceca] | 
committer: Andreas Cadhalpun

asfdec_o: make sure packet_size is non-zero before seeking

This fixes infinite loops due to seeking back.

Reviewed-by: Alexandra Hájková <alexandra.khirn...@gmail.com>
Signed-off-by: Andreas Cadhalpun <andreas.cadhal...@googlemail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3776a72962b0622af17c4aef89a831da2cbaceca
---

 libavformat/asfdec_o.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
index b81519f..4a3c815 100644
--- a/libavformat/asfdec_o.c
+++ b/libavformat/asfdec_o.c
@@ -1287,6 +1287,10 @@ static int asf_read_payload(AVFormatContext *s, AVPacket 
*pkt)
         }
         if (!asf_pkt) {
             if (asf->packet_offset + asf->packet_size <= asf->data_offset + 
asf->data_size) {
+                if (!asf->packet_size) {
+                    av_log(s, AV_LOG_ERROR, "Invalid packet size 0.\n");
+                    return AVERROR_INVALIDDATA;
+                }
                 avio_seek(pb, asf->packet_offset + asf->packet_size, SEEK_SET);
                 av_log(s, AV_LOG_WARNING, "Skipping the stream with the 
invalid stream index %d.\n",
                        asf->stream_index);

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

Reply via email to