Mercurial > libavformat.hg
comparison wav.c @ 1122:f8ee5a4b576e libavformat
use standard codec tag if the specified tag is out of range and would be
truncated
author | mru |
---|---|
date | Fri, 16 Jun 2006 20:45:29 +0000 |
parents | 3aeb079a7e74 |
children | d65cd7c3573e |
comparison
equal
deleted
inserted
replaced
1121:787a70a8b867 | 1122:f8ee5a4b576e |
---|---|
58 int put_wav_header(ByteIOContext *pb, AVCodecContext *enc) | 58 int put_wav_header(ByteIOContext *pb, AVCodecContext *enc) |
59 { | 59 { |
60 int bps, blkalign, bytespersec; | 60 int bps, blkalign, bytespersec; |
61 int hdrsize = 18; | 61 int hdrsize = 18; |
62 | 62 |
63 if(!enc->codec_tag) | 63 if(!enc->codec_tag || enc->codec_tag > 0xffff) |
64 enc->codec_tag = codec_get_tag(codec_wav_tags, enc->codec_id); | 64 enc->codec_tag = codec_get_tag(codec_wav_tags, enc->codec_id); |
65 if(!enc->codec_tag) | 65 if(!enc->codec_tag) |
66 return -1; | 66 return -1; |
67 | 67 |
68 put_le16(pb, enc->codec_tag); | 68 put_le16(pb, enc->codec_tag); |