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 | f751f4356986cb9087bff716ab8589fe54b1546a (patch) | |
tree | 482dff77f2c8611ed610ae3767d728e5bc01a783 /camera | |
parent | dd4ba9d0c08bc76b45a201b353a0b09aa86ec628 (diff) | |
parent | bf97da4dfacdb7d8a5555d6aef166d782f6d0e05 (diff) | |
download | hardware_ti_omap4xxx-f751f4356986cb9087bff716ab8589fe54b1546a.zip hardware_ti_omap4xxx-f751f4356986cb9087bff716ab8589fe54b1546a.tar.gz hardware_ti_omap4xxx-f751f4356986cb9087bff716ab8589fe54b1546a.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; |