X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fsmush.c;h=9c8997cc00ce26fbc1a99de8734320c7489c2895;hb=3a7ef8dc44abe3b8f58cbf69acfd361287c12f2b;hp=b164c7516e90eee5a16f2831b416d862f8b82c1f;hpb=d0ab71ed11c54c40b1c975c713dee8d3993ccdc5;p=ffmpeg diff --git a/libavformat/smush.c b/libavformat/smush.c index b164c7516e9..9c8997cc00c 100644 --- a/libavformat/smush.c +++ b/libavformat/smush.c @@ -32,8 +32,10 @@ typedef struct { static int smush_read_probe(AVProbeData *p) { - if ((AV_RL32(p->buf) == MKTAG('S', 'A', 'N', 'M') || - AV_RL32(p->buf) == MKTAG('A', 'N', 'I', 'M'))) { + if (((AV_RL32(p->buf) == MKTAG('S', 'A', 'N', 'M') && + AV_RL32(p->buf + 8) == MKTAG('S', 'H', 'D', 'R')) || + (AV_RL32(p->buf) == MKTAG('A', 'N', 'I', 'M') && + AV_RL32(p->buf + 8) == MKTAG('A', 'H', 'D', 'R')))) { return AVPROBE_SCORE_MAX; } @@ -209,7 +211,7 @@ static int smush_read_packet(AVFormatContext *ctx, AVPacket *pkt) case MKBETAG('W', 'a', 'v', 'e'): if (size < 13) return AVERROR_INVALIDDATA; - if (av_get_packet(pb, pkt, size) < 0) + if (av_get_packet(pb, pkt, size) < 13) return AVERROR(EIO); pkt->stream_index = smush->audio_stream_index;