Re: [libav-devel] [PATCH] ape: check that number of seektable entries is equal to number of frames

2011-04-01 Thread Kostya
On Fri, Apr 01, 2011 at 09:30:17AM +0200, Anton Khirnov wrote:
 From: Kostya Shishkov kostya.shish...@gmail.com
 
 fixes issue2480
 
 Signed-off-by: Anton Khirnov an...@khirnov.net
 ---
  libavformat/ape.c |5 +
  1 files changed, 5 insertions(+), 0 deletions(-)
 
 diff --git a/libavformat/ape.c b/libavformat/ape.c
 index 6c8880d..5aac00c 100644
 --- a/libavformat/ape.c
 +++ b/libavformat/ape.c
 @@ -250,6 +250,11 @@ static int ape_read_header(AVFormatContext * s, 
 AVFormatParameters * ap)
  av_log(s, AV_LOG_ERROR, Too many frames: %d\n, ape-totalframes);
  return -1;
  }
 +if (ape-seektablelength  (ape-seektablelength / 
 sizeof(*ape-seektable))  ape-totalframes) {
 +av_log(s, AV_LOG_ERROR, Number of seek entries is less than number 
 of frames: %d vs. %d\n,
 +   ape-seektablelength / sizeof(*ape-seektable), 
 ape-totalframes);
 +return AVERROR_INVALIDDATA;
 +}
  ape-frames   = av_malloc(ape-totalframes * sizeof(APEFrame));
  if(!ape-frames)
  return AVERROR(ENOMEM);
 -- 

And I think it's correct patch.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] ape: check that number of seektable entries is equal to number of frames

2011-04-01 Thread Anton Khirnov
On Fri, Apr 01, 2011 at 09:42:14AM +0200, Kostya wrote:
 On Fri, Apr 01, 2011 at 09:30:17AM +0200, Anton Khirnov wrote:
  From: Kostya Shishkov kostya.shish...@gmail.com
  
  fixes issue2480
  
  Signed-off-by: Anton Khirnov an...@khirnov.net
  ---
   libavformat/ape.c |5 +
   1 files changed, 5 insertions(+), 0 deletions(-)
  
  diff --git a/libavformat/ape.c b/libavformat/ape.c
  index 6c8880d..5aac00c 100644
  --- a/libavformat/ape.c
  +++ b/libavformat/ape.c
  @@ -250,6 +250,11 @@ static int ape_read_header(AVFormatContext * s, 
  AVFormatParameters * ap)
   av_log(s, AV_LOG_ERROR, Too many frames: %d\n, ape-totalframes);
   return -1;
   }
  +if (ape-seektablelength  (ape-seektablelength / 
  sizeof(*ape-seektable))  ape-totalframes) {
  +av_log(s, AV_LOG_ERROR, Number of seek entries is less than 
  number of frames: %d vs. %d\n,
  +   ape-seektablelength / sizeof(*ape-seektable), 
  ape-totalframes);
  +return AVERROR_INVALIDDATA;
  +}
   ape-frames   = av_malloc(ape-totalframes * sizeof(APEFrame));
   if(!ape-frames)
   return AVERROR(ENOMEM);
  -- 
 
 And I think it's correct patch.
 ___

Pushed.

-- 
Anton Khirnov


signature.asc
Description: Digital signature
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel