summaryrefslogtreecommitdiff
path: root/libavcodec/pthread.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-11-22 02:54:50 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-11-22 02:54:50 +0100
commit7876f14f8be9d78de1875ff38390d2a37ac86ec3 (patch)
tree10cb7859a2a50ff06552ac8465ea35c61b5679ec /libavcodec/pthread.c
parent2a0e180144a3e96b32b4f2b99e48be59bc8a1915 (diff)
parenta8fe9a7242cfc7351957c0ec086d0722b2a653da (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: pthread: add some malloc failure checks avconv: cosmetics, reformat transcode_init() avconv: rename 'os' variable to 'oc' doc/filters: fix some typos. configure: add libpulse to help output Conflicts: avconv.c configure Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pthread.c')
-rw-r--r--libavcodec/pthread.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index 2096c53ab1..8a2cdbdcdb 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -724,6 +724,11 @@ static int frame_thread_init(AVCodecContext *avctx)
p->parent = fctx;
p->avctx = copy;
+ if (!copy) {
+ err = AVERROR(ENOMEM);
+ goto error;
+ }
+
*copy = *src;
copy->thread_opaque = p;
copy->pkt = &p->avpkt;
@@ -737,6 +742,10 @@ static int frame_thread_init(AVCodecContext *avctx)
update_context_from_thread(avctx, copy, 1);
} else {
copy->priv_data = av_malloc(codec->priv_data_size);
+ if (!copy->priv_data) {
+ err = AVERROR(ENOMEM);
+ goto error;
+ }
memcpy(copy->priv_data, src->priv_data, codec->priv_data_size);
copy->internal = av_malloc(sizeof(AVCodecInternal));
if (!copy->internal) {