Browse Source

lavf/pcm: check size, do not produce invalid packets

Inspired by 92b8c9d89e.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
tags/n1.1
Paul B Mahol 12 years ago
parent
commit
8ca8b43d71
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavformat/pcm.c

+ 2
- 0
libavformat/pcm.c View File

@@ -30,6 +30,8 @@ int ff_pcm_read_packet(AVFormatContext *s, AVPacket *pkt)
int ret, size;

size= RAW_SAMPLES*s->streams[0]->codec->block_align;
if (size <= 0)
return AVERROR(EINVAL);

ret= av_get_packet(s->pb, pkt, size);



Loading…
Cancel
Save