avformat/au: improve au_probe()
This commit is contained in:
parent
d53acf452f
commit
97741adf6f
@ -30,6 +30,7 @@
|
|||||||
#include "config_components.h"
|
#include "config_components.h"
|
||||||
|
|
||||||
#include "libavutil/bprint.h"
|
#include "libavutil/bprint.h"
|
||||||
|
#include "libavutil/intreadwrite.h"
|
||||||
#include "avformat.h"
|
#include "avformat.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
#include "avio_internal.h"
|
#include "avio_internal.h"
|
||||||
@ -63,11 +64,15 @@ static const AVCodecTag *const au_codec_tags[] = { codec_au_tags, NULL };
|
|||||||
|
|
||||||
static int au_probe(const AVProbeData *p)
|
static int au_probe(const AVProbeData *p)
|
||||||
{
|
{
|
||||||
if (p->buf[0] == '.' && p->buf[1] == 's' &&
|
if (p->buf_size < 24 ||
|
||||||
p->buf[2] == 'n' && p->buf[3] == 'd')
|
AV_RL32(p->buf) != MKTAG('.', 's', 'n', 'd') ||
|
||||||
return AVPROBE_SCORE_MAX;
|
AV_RN32(p->buf+4) == 0 ||
|
||||||
else
|
AV_RN32(p->buf+8) == 0 ||
|
||||||
|
AV_RN32(p->buf+12) == 0 ||
|
||||||
|
AV_RN32(p->buf+16) == 0 ||
|
||||||
|
AV_RN32(p->buf+20) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
return AVPROBE_SCORE_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int au_read_annotation(AVFormatContext *s, int size)
|
static int au_read_annotation(AVFormatContext *s, int size)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user