changeset 5748:ee8f29f3f9f7 libavformat

Guard against invalid memory read
author pross
date Thu, 04 Mar 2010 13:26:01 +0000
parents 551765b1772b
children dfbaca29e6fd
files bink.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bink.c	Thu Mar 04 08:53:14 2010 +0000
+++ b/bink.c	Thu Mar 04 13:26:01 2010 +0000
@@ -210,7 +210,7 @@
         }
         bink->remain_packet_size -= 4 + audio_size;
         bink->current_track++;
-        if (audio_size > 0) {
+        if (audio_size >= 4) {
             /* get one audio packet per track */
             if ((ret = av_get_packet(pb, pkt, audio_size))
                                            != audio_size)
@@ -223,6 +223,8 @@
             bink->audio_pts[bink->current_track -1] +=
                 AV_RL32(pkt->data) / (2 * s->streams[bink->current_track]->codec->channels);
             return 0;
+        } else {
+            url_fseek(pb, audio_size, SEEK_CUR);
         }
     }