Browse Source

ea: check chunk_size for validity.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 273e6af47b)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 6a86b705e1)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit e74bc64dd3)

Conflicts:

	libavformat/electronicarts.c
(cherry picked from commit 38c45adfca)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
tags/n0.5.10
Ronald S. Bultje Reinhard Tartler 13 years ago
parent
commit
8ba939fcda
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      libavformat/electronicarts.c

+ 6
- 1
libavformat/electronicarts.c View File

@@ -448,12 +448,17 @@ static int ea_read_packet(AVFormatContext *s,

while (!packet_read) {
chunk_type = get_le32(pb);
chunk_size = (ea->big_endian ? get_be32(pb) : get_le32(pb)) - 8;
chunk_size = ea->big_endian ? get_be32(pb) : get_le32(pb);
if (chunk_size <= 8)
return AVERROR_INVALIDDATA;
chunk_size -= 8;

switch (chunk_type) {
/* audio data */
case ISNh_TAG:
/* header chunk also contains data; skip over the header portion*/
if (chunk_size < 32)
return AVERROR_INVALIDDATA;
url_fskip(pb, 32);
chunk_size -= 32;
case ISNd_TAG:


Loading…
Cancel
Save