Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Alloc image buffer in therading mode.

  • Loading branch information...
commit 250c9e3f915a39a89365e9f53540e86b4e3378ff 1 parent 5db4ac0
huceke authored
Showing with 7 additions and 2 deletions.
  1. +6 −2 crystalhd_decoder.c
  2. +1 −0  crystalhd_h264.c
View
8 crystalhd_decoder.c
@@ -156,8 +156,8 @@ static void crystalhd_video_render (crystalhd_video_decoder_t *this, image_buffe
if(img != NULL && this->use_threading) {
free(img->image);
+ free(img);
}
- free(img);
}
static void* crystalhd_video_rec_thread (void *this_gen) {
@@ -281,13 +281,17 @@ static void* crystalhd_video_rec_thread (void *this_gen) {
continue;
}
- image_buffer_t *img = malloc(sizeof(image_buffer_t));
+ image_buffer_t *img = NULL;
+ image_buffer_t _img;
/* allocate new image buffer and push it to the image list */
if(this->use_threading) {
+ img = malloc(sizeof(image_buffer_t));
img->image = transferbuff;
img->image_bytes = procOut.YbuffSz;
} else {
+ memset(&_img, 0 , sizeof(image_buffer_t));
+ img = &_img;
img->image = procOut.Ybuff;
img->image_bytes = procOut.YBuffDoneSz;
}
View
1  crystalhd_h264.c
@@ -129,6 +129,7 @@ void crystalhd_h264_decode_data (video_decoder_t *this_gen,
if(this->completed_pic) {
free_coded_picture(this->completed_pic);
+ this->completed_pic = NULL;
}
/*
Please sign in to comment.
Something went wrong with that request. Please try again.