summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-19 20:46:37 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-19 21:23:52 +0200
commit2a976debc1de10c22c258583b543ab5b4bbe5974 (patch)
treea2b0a12017a42e8a37365ca84a6bf2a0179311e8 /libavformat
parent2ff935f4bb6173daf3361b2ac7b58c6e33994878 (diff)
parent2b98377935384ecd22c2cd26106b9e03a6c9f598 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: dv: Initialize encoder tables during encoder init. dv: Replace some magic numbers by the appropriate #define. FATE: pass the decoded output format and audio source file to enc_dec_pcm FATE: specify the input format when decoding in enc_dec_pcm() x86inc: support AVX abstraction for 2-operand instructions configure: detect PGI compiler and set suitable flags avconv: check for an incompatible changing channel layout avio: make AVIOContext.av_class pointer to const nutdec: add malloc check and fix const to non-const conversion warnings Conflicts: ffmpeg.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/avio.h2
-rw-r--r--libavformat/nutdec.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 0e923fe443..260bdd95d0 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -78,7 +78,7 @@ typedef struct {
* warning -- this field can be NULL, be sure to not pass this AVIOContext
* to any av_opt_* functions in that case.
*/
- AVClass *av_class;
+ const AVClass *av_class;
unsigned char *buffer; /**< Start of the buffer. */
int buffer_size; /**< Maximum buffer size */
unsigned char *buf_ptr; /**< Current position in the buffer */
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index be2fd82769..29771a2d68 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -305,14 +305,18 @@ static int decode_main_header(NUTContext *nut)
GET_V(nut->header_count, tmp < 128U)
nut->header_count++;
for (i = 1; i < nut->header_count; i++) {
+ uint8_t *hdr;
GET_V(nut->header_len[i], tmp > 0 && tmp < 256);
rem -= nut->header_len[i];
if (rem < 0) {
av_log(s, AV_LOG_ERROR, "invalid elision header\n");
return AVERROR_INVALIDDATA;
}
- nut->header[i] = av_malloc(nut->header_len[i]);
- avio_read(bc, nut->header[i], nut->header_len[i]);
+ hdr = av_malloc(nut->header_len[i]);
+ if (!hdr)
+ return AVERROR(ENOMEM);
+ avio_read(bc, hdr, nut->header_len[i]);
+ nut->header[i] = hdr;
}
assert(nut->header_len[0] == 0);
}