diff options
author | Akwasi Boateng <akwasi.boateng@ti.com> | 2011-11-11 13:42:29 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-11-11 13:42:29 -0800 |
commit | 04879ef96d595873a69f2a80d51d6bde4b3215c7 (patch) | |
tree | 3d32a03b52c7778e92161d22821ebcd4ae6de9cb /camera | |
parent | c03ff1a5a2508ccbf08e189cc3291c542d89b7d5 (diff) | |
parent | 4c8afeaf7f495e22c244cfac92152135d6467b29 (diff) | |
download | hardware_ti_omap4-04879ef96d595873a69f2a80d51d6bde4b3215c7.zip hardware_ti_omap4-04879ef96d595873a69f2a80d51d6bde4b3215c7.tar.gz hardware_ti_omap4-04879ef96d595873a69f2a80d51d6bde4b3215c7.tar.bz2 |
am bf97da4d: am a3be7d18: am cb1183d6: videosnapshot memory corruption fixes.
* commit 'bf97da4dfacdb7d8a5555d6aef166d782f6d0e05':
videosnapshot memory corruption fixes.
Diffstat (limited to 'camera')
-rw-r--r-- | camera/AppCallbackNotifier.cpp | 7 | ||||
-rw-r--r-- | camera/Encoder_libjpeg.cpp | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/camera/AppCallbackNotifier.cpp b/camera/AppCallbackNotifier.cpp index b431f54..ea0d2a8 100644 --- a/camera/AppCallbackNotifier.cpp +++ b/camera/AppCallbackNotifier.cpp @@ -824,7 +824,8 @@ void AppCallbackNotifier::notifyFrame() } CameraParameters parameters; - const String8 strParams(mCameraHal->getParameters()); + char *params = mCameraHal->getParameters(); + const String8 strParams(params); parameters.unflatten(strParams); encode_quality = parameters.getInt(CameraParameters::KEY_JPEG_QUALITY); @@ -894,6 +895,10 @@ void AppCallbackNotifier::notifyFrame() encoder->run(); gEncoderQueue.add(frame->mBuffer, encoder); encoder.clear(); + if (params != NULL) + { + mCameraHal->putParameters(params); + } } else if ( ( CameraFrame::IMAGE_FRAME == frame->mFrameType ) && ( NULL != mCameraHal ) && diff --git a/camera/Encoder_libjpeg.cpp b/camera/Encoder_libjpeg.cpp index f6f6498..0240fb0 100644 --- a/camera/Encoder_libjpeg.cpp +++ b/camera/Encoder_libjpeg.cpp @@ -104,7 +104,7 @@ static void nv21_to_yuv(uint8_t* dst, uint8_t* y, uint8_t* uv, int width) { return; } - while ((width--) >= 0) { + while ((width--) > 0) { uint8_t y0 = y[0]; uint8_t v0 = uv[0]; uint8_t u0 = *(uv+1); @@ -452,6 +452,7 @@ size_t Encoder_libjpeg::encode(params* input) { jpeg_destroy_compress(&cinfo); if (resize_src) free(resize_src); + if (row_tmp) free(row_tmp); exit: input->jpeg_size = dest_mgr.jpegsize; |