diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
| commit | f7813a5324be39d13ab536c245d15dfc602a7849 (patch) | |
| tree | fad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/libavformat/astdec.c | |
| parent | b7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff) | |
basic type mechanism working
Diffstat (limited to 'ffmpeg/libavformat/astdec.c')
| -rw-r--r-- | ffmpeg/libavformat/astdec.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/ffmpeg/libavformat/astdec.c b/ffmpeg/libavformat/astdec.c index 8862744..3fa26dc 100644 --- a/ffmpeg/libavformat/astdec.c +++ b/ffmpeg/libavformat/astdec.c @@ -27,12 +27,15 @@ static int ast_probe(AVProbeData *p) { - if (AV_RL32(p->buf) == MKTAG('S','T','R','M') && - AV_RB16(p->buf + 10) && - AV_RB16(p->buf + 12) && - AV_RB32(p->buf + 16)) - return AVPROBE_SCORE_MAX / 3 * 2; - return 0; + if (AV_RL32(p->buf) != MKTAG('S','T','R','M')) + return 0; + + if (!AV_RB16(p->buf + 10) || + !AV_RB16(p->buf + 12) || AV_RB16(p->buf + 12) > 256 || + !AV_RB32(p->buf + 16) || AV_RB32(p->buf + 16) > 8*48000) + return AVPROBE_SCORE_MAX / 8; + + return AVPROBE_SCORE_MAX / 3 * 2; } static int ast_read_header(AVFormatContext *s) |
