Revision e63a3628 libavformat/soxdec.c

View differences:

libavformat/soxdec.c
55 55

  
56 56
    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
57 57

  
58
    if (get_le32(pb) == SOX_TAG) {
58
    if (avio_rl32(pb) == SOX_TAG) {
59 59
        st->codec->codec_id = CODEC_ID_PCM_S32LE;
60
        header_size         = get_le32(pb);
60
        header_size         = avio_rl32(pb);
61 61
        url_fskip(pb, 8); /* sample count */
62
        sample_rate         = av_int2dbl(get_le64(pb));
63
        st->codec->channels = get_le32(pb);
64
        comment_size        = get_le32(pb);
62
        sample_rate         = av_int2dbl(avio_rl64(pb));
63
        st->codec->channels = avio_rl32(pb);
64
        comment_size        = avio_rl32(pb);
65 65
    } else {
66 66
        st->codec->codec_id = CODEC_ID_PCM_S32BE;
67
        header_size         = get_be32(pb);
67
        header_size         = avio_rb32(pb);
68 68
        url_fskip(pb, 8); /* sample count */
69
        sample_rate         = av_int2dbl(get_be64(pb));
70
        st->codec->channels = get_be32(pb);
71
        comment_size        = get_be32(pb);
69
        sample_rate         = av_int2dbl(avio_rb64(pb));
70
        st->codec->channels = avio_rb32(pb);
71
        comment_size        = avio_rb32(pb);
72 72
    }
73 73

  
74 74
    if (comment_size > 0xFFFFFFFFU - SOX_FIXED_HDR - 4U) {
......
95 95

  
96 96
    if (comment_size && comment_size < UINT_MAX) {
97 97
        char *comment = av_malloc(comment_size+1);
98
        if (get_buffer(pb, comment, comment_size) != comment_size) {
98
        if (avio_read(pb, comment, comment_size) != comment_size) {
99 99
            av_freep(&comment);
100 100
            return AVERROR(EIO);
101 101
        }

Also available in: Unified diff