Revision 19635234

View differences:

libavformat/mov.c
909 909

  
910 910
            get_buffer(pb, codec_name, 32); /* codec name, pascal string */
911 911
            if (codec_name[0] <= 31) {
912
                memcpy(st->codec->codec_name, &codec_name[1],codec_name[0]);
913
                st->codec->codec_name[codec_name[0]] = 0;
912
                int i;
913
                int pos = 0;
914
                for (i = 0; i < codec_name[0] && pos < sizeof(st->codec->codec_name) - 3; i++) {
915
                    uint8_t tmp;
916
                    PUT_UTF8(codec_name[i], tmp, st->codec->codec_name[pos++] = tmp;)
917
                }
918
                st->codec->codec_name[pos] = 0;
914 919
            }
915 920

  
916 921
            st->codec->bits_per_coded_sample = get_be16(pb); /* depth */

Also available in: Unified diff