Commit f273cdb2 authored by aymeric's avatar aymeric
Browse files

replace alloca with ms_malloc0 to avoid stack limitation with big file

git-svn-id: svn+ssh:// 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent 386d602b
...@@ -1597,7 +1597,7 @@ mblk_t *ms_load_jpeg_as_yuv(const char *jpgpath, MSVideoSize *reqsize){ ...@@ -1597,7 +1597,7 @@ mblk_t *ms_load_jpeg_as_yuv(const char *jpgpath, MSVideoSize *reqsize){
m=ms_load_generate_yuv(reqsize); m=ms_load_generate_yuv(reqsize);
return m; return m;
} }
jpgbuf=(uint8_t*)alloca(statbuf.st_size); jpgbuf=(uint8_t*)ms_malloc0(statbuf.st_size);
if (jpgbuf==NULL) if (jpgbuf==NULL)
{ {
#if !defined(_MSC_VER) #if !defined(_MSC_VER)
...@@ -1615,6 +1615,7 @@ mblk_t *ms_load_jpeg_as_yuv(const char *jpgpath, MSVideoSize *reqsize){ ...@@ -1615,6 +1615,7 @@ mblk_t *ms_load_jpeg_as_yuv(const char *jpgpath, MSVideoSize *reqsize){
_read(fd,jpgbuf,statbuf.st_size); _read(fd,jpgbuf,statbuf.st_size);
#endif #endif
m=jpeg2yuv(jpgbuf,statbuf.st_size,reqsize); m=jpeg2yuv(jpgbuf,statbuf.st_size,reqsize);
}else{ }else{
m=ms_load_generate_yuv(reqsize); m=ms_load_generate_yuv(reqsize);
ms_error("Cannot load %s",jpgpath); ms_error("Cannot load %s",jpgpath);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment