From b3e5c8de6a46dd5acb510147df22818d8a971607 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 29 May 2012 19:50:15 +0200 Subject: [PATCH] ape: Fix null ptr dereference with files missing a seekatable. Such files are currently not supported as the table is used at several points Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit e7cb161515fc9fb6d30d1681d64d9ba7ad737a4e) Signed-off-by: Michael Niedermayer --- libavformat/ape.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/ape.c b/libavformat/ape.c index b0f2394ad8..7e18a403c3 100644 --- a/libavformat/ape.c +++ b/libavformat/ape.c @@ -274,6 +274,9 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap) return AVERROR(ENOMEM); for (i = 0; i < ape->seektablelength / sizeof(uint32_t); i++) ape->seektable[i] = avio_rl32(pb); + }else{ + av_log(s, AV_LOG_ERROR, "Missing seektable\n"); + return -1; } ape->frames[0].pos = ape->firstframe;